diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c index 81e05af6ab7b..cce6c0f531af 100644 --- a/lib/libc/string/strxfrm.c +++ b/lib/libc/string/strxfrm.c @@ -51,8 +51,7 @@ strxfrm(char * __restrict dest, const char * __restrict src, size_t len) if (slen < len) strcpy(dest, src); else { - strncpy(dest, src, len - 1); - dest[len - 1] = '\0'; + strlcpy(dest, src, len); } } return slen;