commit 8bbe4f33f1e9a0a92627b7acc613d453fde64f87 parent 6f297f4dce9b2269b052fab6a3bc00873bac65bb Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 3 Jul 2020 19:09:40 +0200 readch() fix checking of read(2) return value Diffstat:
M | sfeed_curses.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c @@ -1410,7 +1410,7 @@ readch(void) ssize_t n; n = read(0, &b, 1); - if (n < 0) + if (n == 0) return EOF; else if (n == -1) err(1, "read");