From 7e8bbea8a8a79e6cb91d340e1b949ac413fd01f1 Mon Sep 17 00:00:00 2001 From: Giorgi Kesidis Date: Fri, 24 Oct 2025 14:24:56 +0200 Subject: [PATCH] =?UTF-8?q?24.10=20=C3=84nderung=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Start_Windows/input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Start_Windows/input.c b/Start_Windows/input.c index ebf3f79..f8cd217 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -8,7 +8,7 @@ // Read words from file and store in 'words' array int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) { - //kein fopen und close nötig, weil dies schon in der main passiert und mit *file übergeben wird// + //kein fopen und fclose nötig, weil dies schon in der main passiert und mit *file übergeben wird// if (file == NULL) @@ -20,12 +20,12 @@ if (file == NULL) char line[1024]; unsigned int count = 0; -while (fgets(line, sizeof(line), file) && count < maxWordCount) +while (fgets(line, sizeof(line), file) && (count < maxWordCount)) { line[strcspn(line, "\n")] = '\0'; char *token = strtok(line, " ;,"); -while (token && count < maxWordCount) +while (token && (count < maxWordCount)) { strcpy(words[count], token); count++;