summaryrefslogtreecommitdiff
path: root/lib/libstand/gets.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libstand/gets.c')
-rw-r--r--lib/libstand/gets.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libstand/gets.c b/lib/libstand/gets.c
index dc26a998b325..3fbe9b4047a3 100644
--- a/lib/libstand/gets.c
+++ b/lib/libstand/gets.c
@@ -95,11 +95,8 @@ fgetstr(char *buf, int size, int fd)
err = read(fd, &c, sizeof(c));
if (err < 0) /* read error */
return(-1);
- if (err == 0) { /* EOF */
- if (len == 0)
- return(-1); /* nothing to read */
+ if (err == 0) /* EOF */
break;
- }
if ((c == '\r') || /* line terminators */
(c == '\n'))
break;