Mercurial > hg > octave-kai > gnulib-hg
changeset 13612:37d5b2cb63ba
hash: silence spurious clang warning
* lib/hash.c (hash_get_next): Remove unnecessary test against NULL.
Reported by Eric Blake.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 31 Aug 2010 08:43:53 +0200 |
parents | 06bf5f91b9df |
children | 7f0f04d7017a |
files | ChangeLog lib/hash.c |
diffstat | 2 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-08-30 Bruno Haible <bruno@clisp.org> + + hash: silence spurious clang warning + * lib/hash.c (hash_get_next): Remove unnecessary test against NULL. + Reported by Eric Blake. + 2010-08-30 Eric Blake <eblake@redhat.com> strstr, memmem, strcasestr: avoid leaked shell message
--- a/lib/hash.c +++ b/lib/hash.c @@ -307,9 +307,14 @@ abort (); /* Find next entry in the same bucket. */ - for (cursor = bucket; cursor; cursor = cursor->next) - if (cursor->data == entry && cursor->next) - return cursor->next->data; + cursor = bucket; + do + { + if (cursor->data == entry && cursor->next) + return cursor->next->data; + cursor = cursor->next; + } + while (cursor != NULL); /* Find first entry in any subsequent bucket. */ while (++bucket < table->bucket_limit)