From: Patrick Delaunay Date: Fri, 3 Aug 2018 11:38:45 +0000 (+0200) Subject: cli: handle getch error X-Git-Tag: v2018.11-rc1~218 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=555e378ca7658e817986e18e4a3f214a7fac60ad;p=oweals%2Fu-boot.git cli: handle getch error Handle getch error (when getch return 0x0) to avoid display issue in the console. Signed-off-by: Patrick Delaunay --- diff --git a/common/cli_readline.c b/common/cli_readline.c index 60a232b065..99b631720e 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -273,6 +273,10 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len, ichar = getcmd_getch(); + /* ichar=0x0 when error occurs in U-Boot getc */ + if (!ichar) + continue; + if ((ichar == '\n') || (ichar == '\r')) { putc('\n'); break;