From b8a6308821ece075bde8167bf873e6a2989f26c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn?= Date: Mon, 27 Oct 2025 14:06:32 +0100 Subject: [PATCH] =?UTF-8?q?Fehlerausgabe=20bei=20ung=C3=BCltigen=20Zeichen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Start_Windows/input.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Start_Windows/input.c b/Start_Windows/input.c index ff247b8..80d39f7 100644 --- a/Start_Windows/input.c +++ b/Start_Windows/input.c @@ -23,6 +23,15 @@ int readWords(FILE *file, char words[][MAX_WORD_LEN], unsigned int maxWordCount) // Alles in Großbuchstaben umwandeln for (int i = 0; token[i]; i++) { token[i] = toupper(token[i]); + + // Prüfen, ob das Wort nur A-Z enthält + if (!isValidWord(token)) + { + fprintf(stderr, "Ungültiges Wort gefunden: '%s'. Nur Buchstaben A-Z erlaubt.\n", token); + token = strtok(NULL, delimiters); + continue; // Wort ignorieren + } + } // Wort ins Array kopieren