summaryrefslogtreecommitdiff
path: root/wk5/pset/speller/dictionary.c
diff options
context:
space:
mode:
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r--wk5/pset/speller/dictionary.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index f479021..b23275a 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -27,13 +27,14 @@ int siz = 0;
bool check(const char *word)
{
// hash word to find bucket
- node *current = table[hash(word)];
+ int val = hash(word);
+ node *current = table[val];
// check all nodes in the bucket
while (current != NULL)
{
// check if this is the word
- if (current->word == word)
+ if (current->word word)
{
return true;
}