summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hashtable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hashtable.c b/src/hashtable.c
index bf46963..60e3359 100644
--- a/src/hashtable.c
+++ b/src/hashtable.c
@@ -73,7 +73,9 @@ pair_t hashtable_get_pair(hashtable_t* hashtable, char* key) {
unsigned int ha = hash + i;
unsigned int ia = ha % hashtable->capacity;
pair_t p = hashtable->pairs[ia];
- return p;
+ if (p.key == NULL || strcmp(p.key, key) == 0) {
+ return p;
+ }
}
return hashtable->pairs[(hash) % hashtable->capacity];
}