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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user