summaryrefslogtreecommitdiff
path: root/wk5/pset/speller
diff options
context:
space:
mode:
Diffstat (limited to 'wk5/pset/speller')
-rw-r--r--wk5/pset/speller/dictionary.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index 12035a5..c777c58 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -63,6 +63,11 @@ unsigned int hash(const char *word)
// Loads dictionary into memory, returning true if successful, else false
bool load(const char *dictionary)
{
+ // initialize the table
+ for (int i = 0; i < N; i++) {
+ table[i]->next = NULL;
+ }
+
// Open dictionary file
FILE *source = fopen(dictionary, "r");
if (source == NULL)