X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=util.c;h=3065607d970d837e44f236a234a33020aa11af94;hp=5157d1cd1027027e1f6e32cdbad25e30af6cf23a;hb=9c0231a58e19bffd5fc354049cc30e09619c14de;hpb=32c928ab6d527199b4404f9789ae8e7a4818e06f 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 */