[PATCH] readline_simple: Fix compiler warning
Sascha Hauer
s.hauer at pengutronix.de
Tue May 11 22:44:40 PDT 2021
char is an unsigned type. To test the getchar() return value against
negative values we have to use a signed type. Use int instead.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
lib/readline_simple.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/readline_simple.c b/lib/readline_simple.c
index fcdbca41a9..2e52bfc2a0 100644
--- a/lib/readline_simple.c
+++ b/lib/readline_simple.c
@@ -44,7 +44,7 @@ int readline (const char *prompt, char *line, int len)
int n = 0; /* buffer index */
int plen = 0; /* prompt length */
int col; /* output column cnt */
- char c;
+ int c;
/* print prompt */
if (prompt) {
--
2.29.2
More information about the barebox
mailing list