summaryrefslogtreecommitdiff
path: root/libiberty/memchr.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-03-28 04:10:24 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-03-28 04:10:24 +0000
commit27f66c0bcbe5f793b652c2aab3ff87bcf01e82a6 (patch)
tree8ea830dc46b128a20488184542dbb60273379f2c /libiberty/memchr.c
parent8e9449099d44be617db4eadd9bde42eed41f883b (diff)
* memchr.c (memchr): Adjust condition to avoid infinite loop.
From-SVN: r40899
Diffstat (limited to 'libiberty/memchr.c')
-rw-r--r--libiberty/memchr.c2
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;