diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-02-04 19:18:54 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-02-04 19:18:54 +0100 |
commit | 32dcfafb3b8cdc22641254d50571b8be1d33fae3 (patch) | |
tree | 731b327a7ca9f9ca0b832c30ab24a8ab505c8b9e /i386/i386at/com.c | |
parent | e6f93609728d0ad864fc2d7dacd9df128eccd37a (diff) |
Fix comstart when the queue is empty
Found by Coverity
* i386/i386at/com.c (comstart): Make `nch' an int. When `getc' returns
-1, just return.
Diffstat (limited to 'i386/i386at/com.c')
-rw-r--r-- | i386/i386at/com.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/i386/i386at/com.c b/i386/i386at/com.c index e1ba71a..6edbca0 100644 --- a/i386/i386at/com.c +++ b/i386/i386at/com.c @@ -618,7 +618,7 @@ void comstart(tp) struct tty *tp; { - char nch; + int nch; #if 0 int i; #endif @@ -654,6 +654,8 @@ comst_4++; } #else nch = getc(&tp->t_outq); + if (nch == -1) + return; if ((nch & 0200) && ((tp->t_flags & LITOUT) == 0)) { timeout((timer_func_t *)ttrstrt, (char *)tp, (nch & 0x7f) + 6); tp->t_state |= TS_TIMEOUT; |