sbase

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

commit e30a8d0536949dc77b9d182d56b4ed9a226dca3f
parent 31662e25b36d24c53ecc620e813101b68743623e
Author: FRIGN <dev@frign.de>
Date:   Mon Feb 29 15:45:16 +0100

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

Diffstat:
libutil/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++; } }