date and time created 80/12/21 16:50:36 by wnj
[unix-history] / usr / src / lib / libcompat / 4.1 / strcatn.c
CommitLineData
f2be8b67
BJ
1/* @(#)strcatn.c 4.1 (Berkeley) %G% */
2/*
3 * Concatenate s2 on the end of s1. S1's space must be large enough.
4 * At most n characters are moved.
5 * Return s1.
6 */
7
8char *
9strcatn(s1, s2, n)
10register char *s1, *s2;
11register n;
12{
13 register char *os1;
14
15 os1 = s1;
16 while (*s1++)
17 ;
18 --s1;
19 while (*s1++ = *s2++)
20 if (--n < 0) {
21 *--s1 = '\0';
22 break;
23 }
24 return(os1);
25}