mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] readline_simple: Fix compiler warning
@ 2021-05-12  5:44 Sascha Hauer
  2021-05-12 11:25 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2021-05-12  5:44 UTC (permalink / raw)
  To: Barebox List

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-12 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12  5:44 [PATCH] readline_simple: Fix compiler warning Sascha Hauer
2021-05-12 11:25 ` Michael Olbrich
2021-05-12 13:04   ` Sascha Hauer
2021-05-12 15:15     ` Jules Maselbas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox