26 char*
strncpy(
char* __restrict dst,
const char* __restrict src,
size_t maxlen)
28 const size_t srclen =
strnlen(src, maxlen);
36 memset(dst + srclen, 0, maxlen - srclen);
char * strncpy(char *__restrict dst, const char *__restrict src, size_t maxlen)
Copies at most maxlen characters of the character array pointed to by src to character array pointed ...
size_t strnlen(const char *str, size_t maxlen)
Returns the length of the given null-terminated byte string.
void * memset(void *dest, int c, size_t n)
Copies the value c into each of the first n characters of the object pointed to by dest.
void * memcpy(void *__restrict dest, const void *__restrict src, size_t n)
Copies n characters from the object pointed to by src to the object pointed to by dest.