From 2c55adc3448bb0d1a3556df98ab1e16588fe10b8 Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Fri, 24 Apr 2020 06:28:52 +0200 Subject: [PATCH] Fix signed char issue on unsigned char systems There is an if (c < 0) check a few lines below which is always false for systems that use the unsigned version of char. This is allowed by the C standard and common on powerpc and arm platforms. --- linenoise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linenoise.c b/linenoise.c index cfe51e76..bc5f0c93 100644 --- a/linenoise.c +++ b/linenoise.c @@ -819,7 +819,7 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd, char *buf, size_t buflen, if (write(l.ofd,prompt,l.plen) == -1) return -1; while(1) { - char c; + signed char c; int nread; char seq[3];