From 86f5a16173ee5a8e22130defca58b03a6b997354 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 4 Jan 2025 15:31:34 +0100 Subject: Start implementing referencing hashmap impl in fuzzer --- lib/hashtable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/hashtable.c b/lib/hashtable.c index 2015b9c..e7799ad 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -108,9 +108,9 @@ int hashtable_remove(HashTable ht, char* key) { for (int i = 0; i < bucket->length; ++i) { HashTableData* data = &bucket->data[i]; - if (strcmp(data->key, key) == 0) { + if (!data->deleted && strcmp(data->key, key) == 0) { data->deleted = 1; - return 0; + return 1; } } -- cgit 1.4.1