cli: handle getch error

Handle getch error (when getch return 0x0) to avoid display issue
in the console.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
lime2-spi
Patrick Delaunay 6 years ago committed by Tom Rini
parent 273a12526c
commit 555e378ca7
  1. 4
      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;

Loading…
Cancel
Save