summaryrefslogtreecommitdiff
path: root/wk5/pset
diff options
context:
space:
mode:
Diffstat (limited to 'wk5/pset')
-rw-r--r--wk5/pset/speller/dictionary.c9
1 files changed, 2 insertions, 7 deletions
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