diff --git a/src/main/c/Hangman/playHangman.c b/src/main/c/Hangman/playHangman.c index ed0e32c..ec36659 100644 --- a/src/main/c/Hangman/playHangman.c +++ b/src/main/c/Hangman/playHangman.c @@ -24,7 +24,10 @@ char getSingleCharInput() { return '\0'; // Error or end of file } - ignoreExtraInput(); // Ignore extra characters + // Check if the last character is a newline, if not, consume the rest of the line + if (input[strlen(input) - 1] != '\n') { + ignoreExtraInput(); + } // Check if only one character is entered if (strlen(input) == 2 && input[1] == '\n') {