Browse Source

fixed an operational error

Josh Bicking 8 years ago
parent
commit
01d56102c7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wordParse.c

+ 1 - 1
wordParse.c

@@ -86,7 +86,7 @@ void readWordsFromFile(FILE* fp){
 
         // Read the word into wordArr
 
-        wordArr = realloc(wordArr, sizeof(char*) * numWords+1);
+        wordArr = realloc(wordArr, sizeof(char*) * (numWords+1));
 
         *(wordArr+numWords) = malloc(sizeof(char) * sizeof(buf));
         strncpy(*(wordArr+numWords),buf, MAX_WORD_SIZE);