musl/src/string/strncat.c
Rich Felker 86339bc4ba fix strncat and wcsncat (double null termination)
also modify wcsncpy to use the same loop logic
2011-05-22 21:58:43 -04:00

10 lines
161 B
C

#include <string.h>
char *strncat(char *d, const char *s, size_t n)
{
char *a = d;
d += strlen(d);
while (n && *s) n--, *d++ = *s++;
*d++ = 0;
return a;
}