diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-11-22 14:58:45 +1000 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-16 14:49:09 -0500 |
commit | d2e64d29c44dee6d455f7705dd1cf1af8674ad9a (patch) | |
tree | 55e5214a63ae6c153146f41449900ecc24463090 | |
parent | 652b504ff2dc41313ad7f38a00e1d5730966f164 (diff) | |
download | u-boot-d2e64d29c44dee6d455f7705dd1cf1af8674ad9a.tar.gz |
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 <steveb@workware.net.au>
-rw-r--r-- | common/cli_readline.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } } |