--- libutil/getlines.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libutil/getlines.c b/libutil/getlines.c index 55e9bf4..8d4fc44 100644 --- a/libutil/getlines.c +++ b/libutil/getlines.c _AT_@ -24,4 +24,9 @@ getlines(FILE *fp, struct linebuf *b) memcpy(b->lines[b->nlines-1], line, linelen); } free(line); + if (strchr(b->lines[b->nlines-1], '\n') == NULL) { + 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] = '\0'; + } } -- 1.9.1 --------------050904030808020402080004--Received on Mon Sep 17 2001 - 00:00:00 CEST
This archive was generated by hypermail 2.3.0 : Wed Feb 11 2015 - 01:24:09 CET