summaryrefslogtreecommitdiff
path: root/sfeed_mbox.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-02-28 17:34:45 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-02-28 17:34:45 +0100
commit502d03d4f3047bdbe7f223354f851b28e16167fd (patch)
treeda15b564b9779418c850b10f345ed42cc2520d28 /sfeed_mbox.c
parent029bb88fc7244b2281b1a26b19d34c4e2ea12769 (diff)
null-terminate line at newline from getline()
Diffstat (limited to 'sfeed_mbox.c')
-rw-r--r--sfeed_mbox.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sfeed_mbox.c b/sfeed_mbox.c
index 940a056..b0a7fb5 100644
--- a/sfeed_mbox.c
+++ b/sfeed_mbox.c
@@ -67,6 +67,8 @@ printfeed(FILE *fp, const char *feedname)
ssize_t linelen;
while ((linelen = getline(&line, &linesize, fp)) > 0) {
+ if (line[linelen - 1] == '\n')
+ line[--linelen] = '\0';
if (!parseline(line, fields))
break;
parsedtime = 0;