aboutsummaryrefslogtreecommitdiff
path: root/vis-menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis-menu.c')
-rw-r--r--vis-menu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vis-menu.c b/vis-menu.c
index a5023e2..1682ed2 100644
--- a/vis-menu.c
+++ b/vis-menu.c
@@ -308,7 +308,8 @@ readstdin() {
static void
xread(int fd, void *buf, size_t nbyte) {
- if (read(fd, buf, nbyte) < 0)
+ ssize_t r = read(fd, buf, nbyte);
+ if (r < 0 || (size_t)r != nbyte)
die("Can not read.");
}