diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/hashtable.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hashtable.h b/src/hashtable.h index 48ffaad..42d0166 100644 --- a/src/hashtable.h +++ b/src/hashtable.h @@ -89,7 +89,9 @@ void table_add(struct table *table, void *key, void *value) { struct bucket **bucket = table_get_bucket(table, key); if (*bucket) { - (*bucket)->value = value; + if (!(*bucket)->value) { + (*bucket)->value = value; + } } else { *bucket = table_new_bucket(key, value); ++table->count; |