summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2001-03-28 05:02:47 +0000
committerDJ Delorie <dj@delorie.com>2001-03-28 05:02:47 +0000
commit03e6e928aab694d02d037fe24abf460be35f8dd9 (patch)
tree79114b437a874e623faf742b5046cf8bdd22ac7a /libiberty
parentce95910c8ba87871689a31ac47d3d3140d00c457 (diff)
downloadgdb-03e6e928aab694d02d037fe24abf460be35f8dd9.tar.gz
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/memchr.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 5780bcdc383..588bd6fcb89 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2001-03-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * memchr.c (memchr): Adjust condition to avoid infinite loop.
+
2001-03-23 Jakub Jelinek <jakub@redhat.com>
* cp-demangle.c (demangle_discriminator): `_0' is discriminator #1,
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;