[PATCH 1/5] readkey: keys are unsigned char

Michael Olbrich m.olbrich at pengutronix.de
Mon Jan 23 09:02:14 PST 2017


Otherwise values > 127 will become negative and are dropped.

Signed-off-by: Michael Olbrich <m.olbrich at pengutronix.de>
---
 lib/readkey.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/readkey.c b/lib/readkey.c
index 2870a5a9fee5..e72da0066bdc 100644
--- a/lib/readkey.c
+++ b/lib/readkey.c
@@ -51,8 +51,8 @@ static const struct esc_cmds esccmds[] = {
 
 int read_key(void)
 {
-	char c;
-	char esc[5];
+	unsigned char c;
+	unsigned char esc[5];
 	c = getchar();
 
 	if (c == 27) {
-- 
2.11.0




More information about the barebox mailing list