From 92e674e41236f642ad867ea5bbc13e28499b2a44 Mon Sep 17 00:00:00 2001 From: Sergey Anufrienko Date: Tue, 28 Oct 2014 16:42:28 +0300 Subject: [PATCH] fix bug leading to losing of hash entries in hash_iter_next --- src/hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hash.c b/src/hash.c index 3acbc15..e28fda0 100644 --- a/src/hash.c +++ b/src/hash.c @@ -250,12 +250,13 @@ const char * hash_iter_next(hash_iterator_t *iter) { hash_t *table = iter->table; hashentry_t *entry = iter->entry; - int i = iter->index + 1; + int i = iter->index; /* advance until we find the next entry */ if (entry != NULL) entry = entry->next; if (entry == NULL) { /* we're off the end of list, search for a new entry */ + i++; while (i < iter->table->length) { entry = table->entries[i]; if (entry != NULL) {