diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-03-28 04:10:24 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-03-28 04:10:24 +0000 |
commit | 27f66c0bcbe5f793b652c2aab3ff87bcf01e82a6 (patch) | |
tree | 8ea830dc46b128a20488184542dbb60273379f2c /libiberty/memchr.c | |
parent | 8e9449099d44be617db4eadd9bde42eed41f883b (diff) |
* memchr.c (memchr): Adjust condition to avoid infinite loop.
From-SVN: r40899
Diffstat (limited to 'libiberty/memchr.c')
-rw-r--r-- | libiberty/memchr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libiberty/memchr.c b/libiberty/memchr.c index cce30039437..89aa98f1d94 100644 --- a/libiberty/memchr.c +++ b/libiberty/memchr.c @@ -50,7 +50,7 @@ memchr (src_void, c, length) { const unsigned char *src = (const unsigned char *)src_void; - while (--length >= 0) + while (length-- > 0) { if (*src == c) return (PTR)src; |