diff options
Diffstat (limited to 'wk5/pset/speller')
-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) |