From 26d80b65aff412a32237c5dad3f96d78c3b33ae6 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Oct 2026 09:55:49 +0100 Subject: [PATCH 1/2] clean up & commit --- Startcode/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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++; } From 8d2a60eaa99f1fc39ce2f25c1dbfce50fbd9b6bd Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Oct 2026 10:01:55 +0100 Subject: [PATCH 2/2] kommentar --- Startcode/game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) {