diff --git a/lib/terminal.c b/lib/terminal.c index 5a8b2fe..7885039 100644 --- a/lib/terminal.c +++ b/lib/terminal.c @@ -149,7 +149,7 @@ static void terminal_process_escape(void) break; } uint16_t terminal_line_new = 0; // new line start - for (uint16_t pos = 0; pos < terminal_line - 1 && pos < LENGTH(terminal_buffer); pos++) { // find for the last line before the current + for (uint16_t pos = 0; pos + 1 < terminal_line && pos < LENGTH(terminal_buffer); pos++) { // find for the last line before the current if ('\0' == terminal_buffer[pos]) { // new line found terminal_line_new = pos + 1; // save new line }