fix strncat and wcsncat (double null termination)
[musl] / src / string / strncat.c
1 #include <string.h>
2
3 char *strncat(char *d, const char *s, size_t n)
4 {
5         char *a = d;
6         d += strlen(d);
7         while (n && *s) n--, *d++ = *s++;
8         *d++ = 0;
9         return a;
10 }