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

This commit is contained in:
delphij 2008-10-17 21:29:05 +00:00
parent 767e2acdc7
commit cae7e20d60

View File

@ -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;