From 77ea70aa3a46753c52e3b30e55a7814c68f19218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Wed, 12 Jun 2019 15:05:37 +0200 Subject: [PATCH] terminal: fix signed overflow warning --- lib/terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }