From f53577c0d4d28b6cfdac6c96192d8a499015ae45 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Fri, 17 Oct 2008 21:29:05 +0000 Subject: [PATCH] Use strlcpy() in !localized case to avoid the -1's. --- lib/libc/string/strxfrm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c index 81e05af6ab7..cce6c0f531a 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;