Pristine Ack-5.5
[Ack-5.5.git] / modules / src / string / strncat.c
1 /* $Id: strncat.c,v 1.5 1994/06/24 11:23:05 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 /* append t to s, upto n characters     
7 */
8
9 #include "ack_string.h"
10
11 char *
12 strncat(s, t, n)
13         register char *s;
14         register _CONST char *t;
15         register _SIZET n;
16 {
17         register char *b = s;
18
19         while (*s++)
20                 ;
21         s--;
22         while ((n-- > 0) && (*s++ = *t++))
23                 ;
24         return b;
25 }