Use strlcpy() in !localized case to avoid the -1's.
This commit is contained in:
parent
0ea291e221
commit
f53577c0d4
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user