From f01c58d2bf64c7c1eead43d06915cbb333f7d54a Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Sat, 5 Jan 2013 20:16:02 +0330 Subject: [PATCH] term: cast characters read from the pty to unsigned char --- term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/term.c b/term.c index 739f6c2..de785a6 100644 --- a/term.c +++ b/term.c @@ -174,7 +174,7 @@ static void waitpty(void) static int readpty(void) { if (ptycur < ptylen) - return ptybuf[ptycur++]; + return (unsigned char) ptybuf[ptycur++]; if (!term->fd) return -1; ptylen = read(term->fd, ptybuf, PTYBUFSIZE); @@ -184,7 +184,7 @@ static int readpty(void) } if (ptylen > 0) { ptycur = 1; - return ptybuf[0]; + return (unsigned char) ptybuf[0]; } return -1; } -- 2.11.4.GIT