Commits

Evan Gates  committed f5382cc

check return of fgets on stdin, so we don't flood when the terminal is killed

  • Participants
  • Parent commits 8f51253
  • Tags 0.2

Comments (0)

Files changed (1)

 			fflush(stdout);
 		}
 		if (FD_ISSET(fileno(stdin), &rd)) {
-			fgets(buf, sizeof(buf), stdin);
-			fputs(buf, out);
+			if (fgets(buf, sizeof(buf), stdin))
+				fputs(buf, out);
 			fflush(out);
 		}
 	}