diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 02:26:33 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2024-04-29 02:26:33 +0000 |
commit | d79a9d68e96e959d9c774c104b4785ad46fe515f (patch) | |
tree | e16620f147dc314bd5f7808f9f825d170d302b99 /wk5/pset/speller/dictionary.c | |
parent | d4da911b235996bd4439a6ee09bf090524407181 (diff) |
Sun, Apr 28, 2024, 7:26 PM -07:00
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r-- | wk5/pset/speller/dictionary.c | 5 |
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) |