Skip to content

Commit f94f819

Browse files
committed
Fix hashtable del bug
1 parent ebdcfdf commit f94f819

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hashtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int hashtable_del(hashtable *ht, char *key) {
145145
&& !strncmp(key, current->key, key_size)) {
146146
prev->next = current->next;
147147
if (current == ht->buckets[bucket]) {
148-
ht->buckets[bucket] = NULL;
148+
ht->buckets[bucket] = prev;
149149
}
150150
free(current->key);
151151
ht->free ? ht->free(current->value):free(current->value);

0 commit comments

Comments
 (0)