summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/getttyent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c
index a4b31aa..2cd965d 100644
--- a/lib/libc/gen/getttyent.c
+++ b/lib/libc/gen/getttyent.c
@@ -82,11 +82,11 @@ getttyent()
while (!index(p, '\n')) {
i = strlen(p);
lbsize += MALLOCCHUNK;
- if ((line = realloc(line, lbsize)) == NULL) {
+ if ((p = realloc(line, lbsize)) == NULL) {
(void)endttyent();
return (NULL);
}
- p = line;
+ line = p;
if (!fgets(&line[i], lbsize - i, tf))
return (NULL);
}
OpenPOWER on IntegriCloud