From: Dale Weiler Date: Sat, 24 Nov 2012 21:46:28 +0000 (+0000) Subject: Some hashtable changes X-Git-Tag: 0.1.9~286 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9c0231a58e19bffd5fc354049cc30e09619c14de;p=xonotic%2Fgmqcc.git Some hashtable changes --- 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 */