mirror of
https://github.com/fluencelabs/musl
synced 2025-06-12 14:31:37 +00:00
fix overrun (n essentially ignored) in wcsncmp
bug report and solution by Richard Pennington
This commit is contained in:
@ -2,6 +2,6 @@
|
||||
|
||||
int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n)
|
||||
{
|
||||
for (; n && *l==*r && *l && *r; l++, r++);
|
||||
for (; n && *l==*r && *l && *r; n--, l++, r++);
|
||||
return n ? *l - *r : 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user