projects
/
oweals
/
musl.git
/ 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 a3ee0e61810df54972d738ab7f70e3f6e46f4df5..37d69629eea37843c8c0e6c54d78f8b5ec669b10 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;
}