strcat.c revision 110605
111397Sswallace/* 211397Sswallace * Copyright (c) 1988, 1993 311397Sswallace * The Regents of the University of California. All rights reserved. 411397Sswallace * 560290Sbde * Redistribution and use in source and binary forms, with or without 650482Speter * modification, are permitted provided that the following conditions 711397Sswallace * are met: 811397Sswallace * 1. Redistributions of source code must retain the above copyright 911397Sswallace * notice, this list of conditions and the following disclaimer. 1011397Sswallace * 2. Redistributions in binary form must reproduce the above copyright 1111397Sswallace * notice, this list of conditions and the following disclaimer in the 1211397Sswallace * documentation and/or other materials provided with the distribution. 1311397Sswallace * 3. All advertising materials mentioning features or use of this software 1411397Sswallace * must display the following acknowledgement: 1511397Sswallace * This product includes software developed by the University of 1611397Sswallace * California, Berkeley and its contributors. 1760290Sbde * 4. Neither the name of the University nor the names of its contributors 1860290Sbde * may be used to endorse or promote products derived from this software 1911397Sswallace * without specific prior written permission. 2011397Sswallace * 2111397Sswallace * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2211397Sswallace * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2360290Sbde * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2460290Sbde * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2560290Sbde * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2660290Sbde * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2760290Sbde * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2860290Sbde * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2960290Sbde * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3060290Sbde * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3111397Sswallace * SUCH DAMAGE. 3260290Sbde * 3311397Sswallace * $FreeBSD: head/sys/libkern/strcat.c 110605 2003-02-10 00:36:27Z hsu $ 3411397Sswallace */ 3511397Sswallace 3611397Sswallace#include <sys/libkern.h> 3760290Sbde 3860290Sbdechar * 3960290Sbdestrcat(char * __restrict s, const char * __restrict append) 4060290Sbde{ 4111397Sswallace char *save = s; 4211397Sswallace 43 for (; *s; ++s); 44 while ((*s++ = *append++) != 0); 45 return(save); 46} 47