summaryrefslogtreecommitdiff
path: root/wk5/pset/speller/dictionary.c
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-29 02:20:16 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-04-29 02:20:16 +0000
commit313f79430b810d1643cdfa5b360c2bd489d6790d (patch)
tree35bc1d22f3d2f1927c1c2bfabf41cd2c0cca48e6 /wk5/pset/speller/dictionary.c
parentdcd864f394fb22fb772f83f8d46ce9166b80bb07 (diff)
Sun, Apr 28, 2024, 7:20 PM -07:00
Diffstat (limited to 'wk5/pset/speller/dictionary.c')
-rw-r--r--wk5/pset/speller/dictionary.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wk5/pset/speller/dictionary.c b/wk5/pset/speller/dictionary.c
index 32b3ff9..6548bdf 100644
--- a/wk5/pset/speller/dictionary.c
+++ b/wk5/pset/speller/dictionary.c
@@ -74,7 +74,7 @@ bool load(const char *dictionary)
char word[LENGTH + 1];
// use fscanf(file, "%s", word) to grab words
// check for ended file
- while(fscanf(source, "%s", word) != 0)
+ while(fscanf(source, "%s", word) == 1)
{
// update size int
siz++;
@@ -88,7 +88,7 @@ bool load(const char *dictionary)
return false;
}
// copy word from fscanf into node using strcpy
- strcpy(word, ptr->word);
+ strcpy(ptr->word);
// set the new ptr
ptr->next = NULL;
// hash the word to find the bucket it goes in