From 9c0231a58e19bffd5fc354049cc30e09619c14de Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Sat, 24 Nov 2012 21:46:28 +0000 Subject: [PATCH] Some hashtable changes --- util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index 5157d1c..3065607 100644 --- a/util.c +++ b/util.c @@ -593,11 +593,11 @@ void util_htset(hash_table_t *ht, const char *key, void *value) { bin = _util_hthash(ht, key); next = ht->table[bin]; - while (next && next->key && strcmp(key, next->key)) + while (next && next->key && strcmp(key, next->key) > 0) last = next, next = next->next; /* already in table, do a replace */ - if (next && next->key && !strcmp(key, next->key)) { + if (next && next->key && !strcmp(key, next->key) == 0) { next->value = value; } else { /* not found, grow a pair man :P */ -- 2.39.2