Feat/input #1

Merged
binneran103617 merged 6 commits from feat/input into main 2026-10-29 21:15:06 +00:00
Showing only changes of commit b685b56273 - Show all commits
+3 -5
View File
@@ -12,16 +12,14 @@ static int createSingleWords(char text[MAX_LINE_LEN], char words[][MAX_WORD_LEN]
int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
{
int wordCount = 0;
int i = 0;
char lineRead[MAX_LINE_LEN];
while(fgets(lineRead, MAX_LINE_LEN, file) != NULL && i < maxWordCount)
while(fgets(lineRead, MAX_LINE_LEN, file) != NULL && wordCount < (int)maxWordCount)
{
wordCount += createSingleWords(lineRead, words, maxWordCount);
i++;
wordCount += createSingleWords(lineRead, words + wordCount, maxWordCount - wordCount);
}
return i; //wordCount
return wordCount; //wordCount
}
static int createSingleWords(char text[MAX_LINE_LEN], char words[][MAX_WORD_LEN], unsigned int maxWordCount)