summaryrefslogtreecommitdiff
path: root/src/hashtable.c
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-02-16 21:58:47 -0800
committerKai Stevenson <kai@kaistevenson.com>2023-02-16 21:58:47 -0800
commite34f5492b0df9ae22de0aaa537018efa2a191d2d (patch)
tree637348c444c2773bc4db2aba47fa791ba6906002 /src/hashtable.c
parentcd4a69bf4b219e2f96de2d86d8ea41ab01d0f5e3 (diff)
changed some stuff to get recursion working, made some more memory leaks
Diffstat (limited to 'src/hashtable.c')
-rw-r--r--src/hashtable.c3
1 files changed, 2 insertions, 1 deletions
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 <stdlib.h>
+#include <string.h>
#include <stdio.h>
#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);