diff --git a/src/system/kernel/debug/debug.c b/src/system/kernel/debug/debug.c index b7263e5a8e..ea6e5c0b98 100644 --- a/src/system/kernel/debug/debug.c +++ b/src/system/kernel/debug/debug.c @@ -231,9 +231,13 @@ read_line(char *buffer, int32 maxLength) } /* supposed to fall through */ default: - buffer[position++] = c; - kputchar(c); + if (isprint(c)) { + buffer[position++] = c; + kputchar(c); + } + break; } + if (position >= maxLength - 2) { buffer[position++] = '\0'; kputchar('\n');