summaryrefslogtreecommitdiff
path: root/wk5/pset
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:36:31 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-28 22:36:31 +0000
commitf0ab3858e266f33cbf6140da699200612289f808 (patch)
treedd7102fc0c6b505a3dfd95f19c92f8b704b5b5c6 /wk5/pset
parent2bfe9fd49e34b09810c4c235b8b039ab9b9d8735 (diff)
Sun, Apr 28, 2024, 3:36 PM -07:00
Diffstat (limited to 'wk5/pset')
-rw-r--r--wk5/pset/speller/dictionary.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index b550e36..b0d1323 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -67,8 +67,11 @@ bool load(const char *dictionary)
}
// copy word from fscanf into node using strcpy
strcpy(ptr->word, word);
+ // set the new ptr
ptr->next = NULL;
+ // hash the word to find the bucket it goes in
int val = hash(word);
+ //
if (table(val)->next != NULL)
{
char = 0;