[hackers] [sbase] Properly increment line lenght on edge-case in getlines() || FRIGN
commit 19c0ca9830e9cdd1ee42e11879fe69405ffb4328
Author: FRIGN <dev_AT_frign.de>
AuthorDate: Mon Feb 29 15:45:16 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Thu Mar 10 08:48:09 2016 +0000
Properly increment line lenght on edge-case in getlines()
diff --git a/libutil/getlines.c b/libutil/getlines.c
index 4af7a25..b912769 100644
--- a/libutil/getlines.c
+++ b/libutil/getlines.c
_AT_@ -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++;
}
}
Received on Thu Mar 10 2016 - 09:48:17 CET
This archive was generated by hypermail 2.3.0
: Thu Mar 10 2016 - 10:00:23 CET