Properly increment line lenght on edge-case in getlines()
This commit is contained in:
parent
eb9bda8787
commit
19c0ca9830
@ -27,5 +27,6 @@ getlines(FILE *fp, struct linebuf *b)
|
||||
b->lines[b->nlines - 1].data = erealloc(b->lines[b->nlines - 1].data, linelen + 2);
|
||||
b->lines[b->nlines - 1].data[linelen] = '\n';
|
||||
b->lines[b->nlines - 1].data[linelen + 1] = '\0';
|
||||
b->lines[b->nlines - 1].len++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user