strncat.c - scc - simple c99 compiler
HTML git clone git://git.simple-cc.org/scc
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
strncat.c (222B)
---
1 #include <string.h>
2
3 #undef strncat
4
5 char *
6 strncat(char *restrict s1, const char *restrict s2, size_t n)
7 {
8 char *ret;
9
10 for (ret = s1; *s1; ++s1)
11 ;
12 while (n-- > 0 && *s2)
13 *s1++ = *s2++;
14 *s1 = '\0';
15
16 return ret;
17 }