strcat.c revision 103012
1241900Sdim/* 2241900Sdim * Copyright (c) 1988, 1993 3241900Sdim * The Regents of the University of California. All rights reserved. 4241900Sdim * 5241900Sdim * Redistribution and use in source and binary forms, with or without 6241900Sdim * modification, are permitted provided that the following conditions 7241900Sdim * are met: 8241900Sdim * 1. Redistributions of source code must retain the above copyright 9241900Sdim * notice, this list of conditions and the following disclaimer. 10241900Sdim * 2. Redistributions in binary form must reproduce the above copyright 11241900Sdim * notice, this list of conditions and the following disclaimer in the 12241900Sdim * documentation and/or other materials provided with the distribution. 13241900Sdim * 3. All advertising materials mentioning features or use of this software 14241900Sdim * must display the following acknowledgement: 15241900Sdim * This product includes software developed by the University of 16241900Sdim * California, Berkeley and its contributors. 17241900Sdim * 4. Neither the name of the University nor the names of its contributors 18241900Sdim * may be used to endorse or promote products derived from this software 19241900Sdim * without specific prior written permission. 20241900Sdim * 21241900Sdim * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22241900Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23241900Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24241900Sdim * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25241900Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26241900Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27241900Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28241900Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29241900Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30241900Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31241900Sdim * SUCH DAMAGE. 32241900Sdim */ 33241900Sdim 34241900Sdim#if defined(LIBC_SCCS) && !defined(lint) 35241900Sdimstatic char sccsid[] = "@(#)strcat.c 8.1 (Berkeley) 6/4/93"; 36241900Sdim#endif /* LIBC_SCCS and not lint */ 37241900Sdim#include <sys/cdefs.h> 38241900Sdim__FBSDID("$FreeBSD: head/lib/libc/string/strcat.c 103012 2002-09-06 11:24:06Z tjr $"); 39241900Sdim 40241900Sdim#include <string.h> 41241900Sdim 42241900Sdimchar * 43241900Sdimstrcat(char * __restrict s, const char * __restrict append) 44241900Sdim{ 45241900Sdim char *save = s; 46241900Sdim 47241900Sdim for (; *s; ++s); 48241900Sdim while ((*s++ = *append++)); 49241900Sdim return(save); 50241900Sdim} 51241900Sdim