X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fcli_readline.c;h=99b631720e17b02fdc41f524d7a733b19bb72750;hb=407b5b956a2e0facf6668fc8b295f4be9205c83e;hp=ecded11ca3985f27b132ef4d20f7e79ee02c8379;hpb=fc18e9b3d5507845ea8a60a101ee3a368316068e;p=oweals%2Fu-boot.git diff --git a/common/cli_readline.c b/common/cli_readline.c index ecded11ca3..99b631720e 100644 --- a/common/cli_readline.c +++ b/common/cli_readline.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. @@ -5,8 +6,6 @@ * Add to readline cmdline-editing by * (C) Copyright 2005 * JinHua Luo, GuangDong Linux Center, - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -274,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;