From 65a4dbf9c9200acc012475a9ac5d51111bd4e145 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Mon, 13 May 2019 10:44:32 +0100 Subject: [PATCH] fix: counting of content-lines header --- email/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/email/parse.c b/email/parse.c index cd3bd61d3..1c54e3483 100644 --- a/email/parse.c +++ b/email/parse.c @@ -1391,10 +1391,10 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off #ifdef SUN_ATTACHMENT if (mutt_param_get(&new->parameter, "content-lines")) { - int lines; + int lines = 0; if (mutt_str_atoi(mutt_param_get(&new->parameter, "content-lines"), &lines) < 0) lines = 0; - for (; lines; lines--) + for (; lines > 0; lines--) if ((ftello(fp) >= end_off) || !fgets(buf, sizeof(buf), fp)) break; } -- 2.40.0