From: Steve Bennett Date: Sun, 22 Nov 2020 04:58:45 +0000 (+1000) Subject: cli_readline: Only insert printable chars X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20%24image.RelPermalink%20%7D%7D?a=commitdiff_plain;h=d2e64d29c44dee6d455f7705dd1cf1af8674ad9a;p=u-boot.git cli_readline: Only insert printable chars There should be no need to insert non-printable characters and this prevents line editing getting confused. Signed-off-by: Steve Bennett --- diff --git a/common/cli_readline.c b/common/cli_readline.c index 47b876285c..5c158d03b4 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -493,8 +493,10 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len, } #endif default: - cread_add_char(ichar, insert, &num, &eol_num, buf, - *len); + if (ichar >= ' ' && ichar <= '~') { + cread_add_char(ichar, insert, &num, &eol_num, + buf, *len); + } break; } }