xref: /csrg-svn/lib/libc/string/strncat.c (revision 35093)
11987Swnj /*
2*35093Sbostic  * Copyright (c) 1988 Regents of the University of California.
3*35093Sbostic  * All rights reserved.
4*35093Sbostic  *
5*35093Sbostic  * Redistribution and use in source and binary forms are permitted
6*35093Sbostic  * provided that the above copyright notice and this paragraph are
7*35093Sbostic  * duplicated in all such forms and that any documentation,
8*35093Sbostic  * advertising materials, and other materials related to such
9*35093Sbostic  * distribution and use acknowledge that the software was developed
10*35093Sbostic  * by the University of California, Berkeley.  The name of the
11*35093Sbostic  * University may not be used to endorse or promote products derived
12*35093Sbostic  * from this software without specific prior written permission.
13*35093Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*35093Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*35093Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
161987Swnj  */
171987Swnj 
18*35093Sbostic #if defined(LIBC_SCCS) && !defined(lint)
19*35093Sbostic static char sccsid[] = "@(#)strncat.c	5.3 (Berkeley) 07/18/88";
20*35093Sbostic #endif /* LIBC_SCCS and not lint */
21*35093Sbostic 
221987Swnj char *
23*35093Sbostic strncat(s, append, cnt)
24*35093Sbostic 	register char *s, *append;
25*35093Sbostic 	register int cnt;
261987Swnj {
27*35093Sbostic 	char *save = s;
281987Swnj 
29*35093Sbostic 	for (; *s; ++s);
30*35093Sbostic 	for (; cnt; --cnt)
31*35093Sbostic 		*s++ = *append++;
32*35093Sbostic 	*s = '\0';
33*35093Sbostic 	return(save);
341987Swnj }
35