From: Kevin McCarthy Date: Tue, 14 Aug 2018 01:22:58 +0000 (-0700) Subject: Convert abort_noattach scan to use mutt_read_line(). X-Git-Tag: mutt-1-11-rel~92 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f721883db717a92883eb9a59018c9d31db41aa4d;p=mutt Convert abort_noattach scan to use mutt_read_line(). I should have fixed this up before committing the patch. --- diff --git a/send.c b/send.c index 1a286058..316904b8 100644 --- a/send.c +++ b/send.c @@ -1136,7 +1136,8 @@ static int has_recips (ADDRESS *a) static int has_attach_keyword (char *filename) { int match = 0; - char buffer[LONG_STRING]; + char *buf = NULL; + size_t blen = 0; FILE *fp; if ((fp = safe_fopen (filename, "r")) == NULL) @@ -1145,15 +1146,16 @@ static int has_attach_keyword (char *filename) return 0; } - while (fgets (buffer, sizeof(buffer), fp) != NULL) + while ((buf = mutt_read_line (buf, &blen, fp, NULL, 0)) != NULL) { - if (regexec (AbortNoattachRegexp.rx, buffer, 0, NULL, 0) == 0) + if (regexec (AbortNoattachRegexp.rx, buf, 0, NULL, 0) == 0) { match = 1; break; } } safe_fclose (&fp); + FREE (&buf); return match; }