getchar() must be assigned to an int to handle EOF properly.

modified:   src/nmstermio.c
This commit is contained in:
Brian Barto 2017-09-20 08:35:08 -04:00
parent d8a8449aba
commit 39c02de520
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ void nmstermio_clear_input(void) {
char nmstermio_get_char(void) {
struct timespec ts;
int t = 50;
char c;
int c;
ts.tv_sec = t / 1000;
ts.tv_nsec = (t % 1000) * 1000000;
@ -168,7 +168,7 @@ char nmstermio_get_char(void) {
nanosleep(&ts, NULL);
}
return c;
return (char)c;
}
/*