diff --git a/Startcode/game.c b/Startcode/game.c index 4bf47fc..4b23fa9 100644 --- a/Startcode/game.c +++ b/Startcode/game.c @@ -21,7 +21,7 @@ int createWordSalad(char salad[MAX_SEARCH_FIELD_LEN][MAX_SEARCH_FIELD_LEN], unsi { - for(int i = 0; i < searchFieldLen; i++) + for(int i = 0; i < searchFieldLen; i++) // jeden Platz erstmal mit EMTPY_CHAR ausfüllen { for(int j = 0; j < searchFieldLen; j++) { diff --git a/Startcode/input.c b/Startcode/input.c index 7674aeb..1ace39d 100644 --- a/Startcode/input.c +++ b/Startcode/input.c @@ -8,7 +8,7 @@ int leseEinWort(FILE *file, char zielWort[]) { int c; int i = 0; - while((c = fgetc(file)) != EOF) // liest aus Textdatei und überprüft ob End Of File ist + while((c = fgetc(file)) != EOF) // liest aus Textdatei und überprüft ob End Of File ist. fgetc liest exakt ein einzelnes Zeichen. fgetc komplette Zeile { @@ -39,7 +39,7 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { int anzahl = 0; - while((leseEinWort(file, words[anzahl])) == 1 && anzahl < maxWordCount) + while((anzahl < maxWordCount && leseEinWort(file, words[anzahl])) == 1) { anzahl++; }