ref: 620493c9bdc92f1d4309f1b6bbf9c23f2000aecb
dir: /lib/c/src/strncpy.c/
#include <string.h> #undef strncpy char * strncpy(char * restrict dst, const char * restrict src, size_t n) { char *ret = dst; for (; n > 0 && *src; --n) *dst++ = *src++; while (n-- > 0) *dst++ = '\0'; return ret; }