summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/getttyent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c
index 8249fad..efc4c9b 100644
--- a/lib/libc/gen/getttyent.c
+++ b/lib/libc/gen/getttyent.c
@@ -97,7 +97,7 @@ getttyent()
return (NULL);
}
/* extend buffer if line was too big, and retry */
- while (!index(p, '\n')) {
+ while (!index(p, '\n') && !feof(tf)) {
i = strlen(p);
lbsize += MALLOCCHUNK;
if ((p = realloc(line, lbsize)) == NULL) {
OpenPOWER on IntegriCloud