sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 19c0ca9830e9cdd1ee42e11879fe69405ffb4328
parent eb9bda878736344d1bef06d42e57e96de542a663
Author: FRIGN <dev@frign.de>
Date:   Mon, 29 Feb 2016 15:45:16 +0100

Properly increment line lenght on edge-case in getlines()

Diffstat:
Mlibutil/getlines.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/libutil/getlines.c b/libutil/getlines.c @@ -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++; } }