Browse code

Initialize fd_set correctly

Jason Felice authored on 04/05/2018 15:42:34
Showing 1 changed files

... ...
@@ -90,6 +90,7 @@ char tty_getchar(tty_t *tty) {
90 90
 int tty_input_ready(tty_t *tty) {
91 91
 	fd_set readfs;
92 92
 	struct timeval tv = {0, 0};
93
+	FD_ZERO(&readfs);
93 94
 	FD_SET(tty->fdin, &readfs);
94 95
 	select(tty->fdin + 1, &readfs, NULL, NULL, &tv);
95 96
 	return FD_ISSET(tty->fdin, &readfs);