From e34f5492b0df9ae22de0aaa537018efa2a191d2d Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Thu, 16 Feb 2023 21:58:47 -0800 Subject: changed some stuff to get recursion working, made some more memory leaks --- src/hashtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/hashtable.c') diff --git a/src/hashtable.c b/src/hashtable.c index 2f4ca64..2506c5b 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -1,4 +1,5 @@ #include +#include #include #include "hashtable.h" @@ -40,7 +41,7 @@ unsigned int hashtable_add_pair(hashtable_t* hashtable, pair_t pair) { } pair_t hashtable_get_pair(hashtable_t* hashtable, char* key) { unsigned int hash = get_hash(key); - return hashtable->pairs[hash % hashtable->capacity]; + return hashtable->pairs[(hash) % hashtable->capacity]; } pair_t hashtable_get_pair_recurse(hashtable_t* origin, char* key) { pair_t pair = hashtable_get_pair(origin, key); -- cgit v1.3.1