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

---
 wk5/pset/speller/dictionary.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

(limited to 'wk5/pset')

diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index b23275a..1bfc12b 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -34,15 +34,10 @@ bool check(const char *word)
     while (current != NULL)
     {
         // check if this is the word
-        if (current->word word)
+        if (strcmp(current->word, word) == 0)
         {
             return true;
         }
-        // move on to next node
-        if (current->next == NULL)
-        {
-            return false;
-        }
         current = current->next;
     }
 
@@ -67,7 +62,7 @@ bool load(const char *dictionary)
     // initialize the table
     for (int i = 0; i < N; i++) {
         // malloc size of next
-        table[i]->next = 0;
+        table[i] = NULL;
     }
 
     // Open dictionary file
-- 
cgit v1.2.3