mirror of git://git.musl-libc.org/musl
fix return value of wmemcmp for extreme wchar_t values
analogous to the bug in wcscmp and wcsncmp that was fixed in commit
07616721f1
.
This commit is contained in:
parent
4724793f96
commit
b928c7234f
|
@ -3,5 +3,5 @@
|
|||
int wmemcmp(const wchar_t *l, const wchar_t *r, size_t n)
|
||||
{
|
||||
for (; n && *l==*r; n--, l++, r++);
|
||||
return n ? *l-*r : 0;
|
||||
return n ? (*l < *r ? -1 : *l > *r) : 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue