check return value of fgets and exit main loop if EOF is received
This commit is contained in:
parent
7ecc02bc80
commit
4e1d114f4e
4
bar.c
4
bar.c
|
@ -568,7 +568,9 @@ main (int argc, char **argv)
|
||||||
else break; /* ...bail out */
|
else break; /* ...bail out */
|
||||||
}
|
}
|
||||||
if (pollin[0].revents & POLLIN) { /* New input, process it */
|
if (pollin[0].revents & POLLIN) { /* New input, process it */
|
||||||
fgets (input, sizeof(input), stdin);
|
if (fgets (input, sizeof(input), stdin) == NULL)
|
||||||
|
break; /* EOF received */
|
||||||
|
|
||||||
parse (input);
|
parse (input);
|
||||||
redraw = 1;
|
redraw = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user