projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4724793
)
fix return value of wmemcmp for extreme wchar_t values
author
Rich Felker
<dalias@aerifal.cx>
Mon, 24 Apr 2023 15:21:13 +0000
(11:21 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 24 Apr 2023 15:23:39 +0000
(11:23 -0400)
analogous to the bug in wcscmp and wcsncmp that was fixed in commit
07616721f1fa6cb215ffbef23441cae80412484f
.
src/string/wmemcmp.c
patch
|
blob
|
history
diff --git
a/src/string/wmemcmp.c
b/src/string/wmemcmp.c
index
2a19326
..
717d77b
100644
(file)
--- a/
src/string/wmemcmp.c
+++ b/
src/string/wmemcmp.c
@@
-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;
}