diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 02:44:13 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 02:44:13 +0000 |
commit | 0b1aa11c8f47ee4ce69ce988b8dd51d5859cce99 (patch) | |
tree | 575d0aa5929abfb3ef6b7709b30f7830b7423314 /wk5/pset/speller/dictionary.c | |
parent | eff41ddbeee88c65872923423276042dc5604529 (diff) |
Sun, Apr 28, 2024, 7:44 PM -07:00
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r-- | wk5/pset/speller/dictionary.c | 9 |
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 |