# HG changeset patch # User Bruno Haible # Date 1283237033 -7200 # Node ID 37d5b2cb63ba217d76b7c52611cbffe7c671dcc2 # Parent 06bf5f91b9df07609f6711babee85c49fde105be hash: silence spurious clang warning * lib/hash.c (hash_get_next): Remove unnecessary test against NULL. Reported by Eric Blake. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-08-30 Bruno Haible + + 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 strstr, memmem, strcasestr: avoid leaked shell message diff --git a/lib/hash.c b/lib/hash.c --- 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)