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