diff --git a/musl_src.gni b/musl_src.gni index a298e06f63a3518b7b8b3032f6f12d00ebfe9a92..68987ebdbf60bc8a18bc64af5354a48fd0bfc3ca 100644 --- a/musl_src.gni +++ b/musl_src.gni @@ -2207,6 +2207,7 @@ musl_src_porting_file = [ "src/env/getenv.c", "src/string/strcasecmp.c", "src/string/strncasecmp.c", + "src/string/strncat.c", "src/string/stpncpy.c", "src/string/strncpy.c", "src/string/strcspn.c", diff --git a/porting/linux/user/src/string/strncat.c b/porting/linux/user/src/string/strncat.c new file mode 100644 index 0000000000000000000000000000000000000000..01fc0a022b4384417cc5e7d1af460e56fa66905d --- /dev/null +++ b/porting/linux/user/src/string/strncat.c @@ -0,0 +1,10 @@ +#include + +char *strncat(char *restrict d, const char *restrict s, size_t n) +{ + char *a = d; + while (*d != 0) d++; + while (n && *s) n--, *d++ = *s++; + *d++ = 0; + return a; +}