Explorar o código

fixed an operational error

Josh Bicking %!s(int64=9) %!d(string=hai) anos
pai
achega
01d56102c7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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);