libutil/getlines: style fix
This commit is contained in:
parent
9f97430143
commit
27f258dd34
|
@ -22,9 +22,7 @@ getlines(FILE *fp, struct linebuf *b)
|
||||||
b->lines[b->nlines - 1] = memcpy(emalloc(linelen), line, linelen);
|
b->lines[b->nlines - 1] = memcpy(emalloc(linelen), line, linelen);
|
||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
if(!b->nlines || !b->lines)
|
if (b->lines && b->nlines && !strchr(b->lines[b->nlines - 1], '\n')) {
|
||||||
return;
|
|
||||||
if (!strchr(b->lines[b->nlines - 1], '\n')) {
|
|
||||||
b->lines[b->nlines - 1] = erealloc(b->lines[b->nlines - 1], linelen + 1);
|
b->lines[b->nlines - 1] = erealloc(b->lines[b->nlines - 1], linelen + 1);
|
||||||
b->lines[b->nlines - 1][linelen - 1] = '\n';
|
b->lines[b->nlines - 1][linelen - 1] = '\n';
|
||||||
b->lines[b->nlines - 1][linelen] = '\0';
|
b->lines[b->nlines - 1][linelen] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user