Use a char, not a char[1] in ttgetc and cast the return value to int.
authormillert <millert@openbsd.org>
Thu, 2 Mar 2000 17:01:41 +0000 (17:01 +0000)
committermillert <millert@openbsd.org>
Thu, 2 Mar 2000 17:01:41 +0000 (17:01 +0000)
Perhaps this should really be a u_char but I don't think it really matters.

usr.bin/mg/ttyio.c

index 166e9a8..31bc386 100644 (file)
@@ -159,11 +159,11 @@ ttflush()
 int
 ttgetc()
 {
-       char    buf[1];
+       char    c;
 
-       while (read(0, &buf[0], 1) != 1)
+       while (read(0, &c, 1) != 1)
                ;
-       return (buf[0] & 0xFF);
+       return ((int) c);
 }
 
 /*