Compare commits

..

No commits in common. "bbdb1f22082148f360d267fb3ee35f2ba8c49e21" and "7fd01a91557112a35f3929485b82e95289a45a9e" have entirely different histories.

3 changed files with 8 additions and 8 deletions

View File

@ -10,9 +10,9 @@ static char *buffer;
// Read words from file and store in 'words' array // Read words from file and store in 'words' array
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
{ {
int i = 0; int i = 0;
int word = 0; int word = 0;
int wordChar = 0; int wordChar = 0;
int firstLetter = 0; int firstLetter = 0;
if (file == NULL) if (file == NULL)
@ -20,7 +20,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
return 0; return 0;
} }
fgets(buffer, MAX_LINE_LEN * maxWordCount, file); fgets(buffer, MAX_LINE_LEN, file);
//fscanf(file, "%s", buffer); //fscanf(file, "%s", buffer);
do do
@ -55,7 +55,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
} }
i++; i++;
} while ((i < MAX_LINE_LEN) && (word < maxWordCount)); } while ((i < MAX_LINE_LEN) || (word < maxWordCount));
return word + 1; return word+1;
} }

Binary file not shown.

Binary file not shown.