diff options
| author | Rich Felker <dalias@aerifal.cx> | 2011-03-17 22:38:45 -0400 |
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2011-03-17 22:38:45 -0400 |
| commit | a012aa879fb790c8e0446638b206b7f34e92c51e (patch) | |
| tree | 7e10cf714e5a947158a1799529b186321545ec15 | |
| parent | 047e434ef5fd5437a74f98f63c40a77a683f7f3f (diff) | |
| download | musl-a012aa879fb790c8e0446638b206b7f34e92c51e.tar.gz | |
fix broken wmemchr (unbounded search)
| -rw-r--r-- | src/string/wmemchr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/wmemchr.c b/src/string/wmemchr.c index a3ee0e61..37d69629 100644 --- 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; } |
