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