Use strlcpy() in !localized case to avoid the -1's.

This commit is contained in:
Xin LI 2008-10-17 21:29:05 +00:00
parent 0ea291e221
commit f53577c0d4

View File

@ -51,8 +51,7 @@ strxfrm(char * __restrict dest, const char * __restrict src, size_t len)
if (slen < len) if (slen < len)
strcpy(dest, src); strcpy(dest, src);
else { else {
strncpy(dest, src, len - 1); strlcpy(dest, src, len);
dest[len - 1] = '\0';
} }
} }
return slen; return slen;