PatchworkOS
Loading...
Searching...
No Matches
strncat.c
Go to the documentation of this file.
1#include <string.h>
2
3char* strncat(char* _RESTRICT s1, const char* _RESTRICT s2, size_t n)
4{
5 char* rc = s1;
6
7 while (*s1)
8 {
9 ++s1;
10 }
11
12 while (n && (*s1++ = *s2++))
13 {
14 --n;
15 }
16
17 if (n == 0)
18 {
19 *s1 = '\0';
20 }
21
22 return rc;
23}
#define _RESTRICT
Definition config.h:17
char * strncat(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
Definition strncat.c:3