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>
This commit is contained in:
parent
273a12526c
commit
555e378ca7
@ -273,6 +273,10 @@ static int cread_line(const char *const prompt, char *buf, unsigned int *len,
|
|||||||
|
|
||||||
ichar = getcmd_getch();
|
ichar = getcmd_getch();
|
||||||
|
|
||||||
|
/* ichar=0x0 when error occurs in U-Boot getc */
|
||||||
|
if (!ichar)
|
||||||
|
continue;
|
||||||
|
|
||||||
if ((ichar == '\n') || (ichar == '\r')) {
|
if ((ichar == '\n') || (ichar == '\r')) {
|
||||||
putc('\n');
|
putc('\n');
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user