From d79a9d68e96e959d9c774c104b4785ad46fe515f Mon Sep 17 00:00:00 2001
From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com>
Date: Mon, 29 Apr 2024 02:26:33 +0000
Subject: Sun, Apr 28, 2024, 7:26 PM -07:00

---
 wk5/pset/speller/dictionary.c | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'wk5')

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)
-- 
cgit v1.2.3