]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Some hashtable changes
authorDale Weiler <killfieldengine@gmail.com>
Sat, 24 Nov 2012 21:46:28 +0000 (21:46 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 24 Nov 2012 21:46:28 +0000 (21:46 +0000)
util.c

diff --git a/util.c b/util.c
index 5157d1cd1027027e1f6e32cdbad25e30af6cf23a..3065607d970d837e44f236a234a33020aa11af94 100644 (file)
--- 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 */