In getttyent(3), if /etc/ttys doesn't end in a newline, don't

freak out and keep trying to expand the buffer until realloc()
fails.

PR:	114398
This commit is contained in:
David Schultz 2008-01-15 06:50:50 +00:00
parent eee55ebda9
commit 00a32d0ca9

View File

@ -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) {