diff --git a/linenoise.c b/linenoise.c
index d2a72af..eb2614c 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];