diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-28 04:10:24 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-28 04:10:24 +0000 |
commit | b130ede94bcece335b2dae0de6a93aee6c51a5fa (patch) | |
tree | 8ea830dc46b128a20488184542dbb60273379f2c /libiberty/memchr.c | |
parent | f73397be837d3dc56a1be1e904924b83246e9972 (diff) | |
download | gcc-b130ede94bcece335b2dae0de6a93aee6c51a5fa.tar.gz |
* memchr.c (memchr): Adjust condition to avoid infinite loop.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40899 138bc75d-0d04-0410-961f-82ee72b054a4
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; |