From 26d80b65aff412a32237c5dad3f96d78c3b33ae6 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 29 Oct 2026 09:55:49 +0100 Subject: [PATCH] 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++; }