term: cast characters read from the pty to unsigned char
authorAli Gholami Rudi <ali@rudi.ir>
Sat, 5 Jan 2013 16:46:02 +0000 (5 20:16 +0330)
committerAli Gholami Rudi <ali@rudi.ir>
Sat, 5 Jan 2013 17:01:59 +0000 (5 20:31 +0330)
term.c

diff --git a/term.c b/term.c
index 739f6c2..de785a6 100644 (file)
--- 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;
 }