mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Do not attempt ro read more than sizeof(buf) from stdin.
This commit is contained in:
parent
3581cc66bb
commit
72d8d1c7f3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129090
|
@ -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 a new issue