forked from freudenreichan/info2Praktikum-Wortsalat
input Versuch 2
This commit is contained in:
1 parent
42a1ab8168
commit
afdd93f035
1 file changed
+2
-1
+2
-1
@@ -11,9 +11,10 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount)
|
|||||||
|
|
||||||
|
|
||||||
unsigned int wordCount = 0;
|
unsigned int wordCount = 0;
|
||||||
while(fgets(words[wordCount],MAX_WORD_LEN,file) != NULL){
|
while(fgets(words[wordCount],MAX_WORD_LEN,file) != NULL && wordCount+1 < maxWordCount){
|
||||||
wordCount++;
|
wordCount++;
|
||||||
}
|
}
|
||||||
|
return wordCount;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user