projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
047e434
)
fix broken wmemchr (unbounded search)
author
Rich Felker
<dalias@aerifal.cx>
Fri, 18 Mar 2011 02:38:45 +0000
(22:38 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 18 Mar 2011 02:38:45 +0000
(22:38 -0400)
src/string/wmemchr.c
patch
|
blob
|
history
diff --git
a/src/string/wmemchr.c
b/src/string/wmemchr.c
index
a3ee0e6
..
37d6962
100644
(file)
--- a/
src/string/wmemchr.c
+++ b/
src/string/wmemchr.c
@@
-3,6
+3,6
@@
wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n)
{
- for (; n && *s != c; s++);
+ for (; n && *s != c;
n--,
s++);
return n ? (wchar_t *)s : 0;
}