Do not attempt ro read more than sizeof(buf) from stdin.
This commit is contained in:
parent
3581cc66bb
commit
72d8d1c7f3
@ -138,6 +138,8 @@ talk()
|
||||
*/
|
||||
int i;
|
||||
ioctl(0, FIONREAD, (void *) &nb);
|
||||
if (nb > sizeof buf)
|
||||
nb = sizeof buf;
|
||||
nb = read(STDIN_FILENO, buf, nb);
|
||||
display(&my_win, buf, nb);
|
||||
/* might lose data here because sockt is non-blocking */
|
||||
|
Loading…
Reference in New Issue
Block a user