fix broken wmemchr (unbounded search)
This commit is contained in:
parent
047e434ef5
commit
a012aa879f
1 changed files with 1 additions and 1 deletions
|
|
@ -3,6 +3,6 @@
|
||||||
|
|
||||||
wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n)
|
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;
|
return n ? (wchar_t *)s : 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue