From: Marco Sirabella Date: Fri, 22 Jun 2018 16:01:13 +0000 (-0400) Subject: Remove pgpoutfile from pgp_class_application_handler X-Git-Tag: neomutt-20180716~24^2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad9de65b9da920bc9913058deb779f00b2b24440;p=neomutt Remove pgpoutfile from pgp_class_application_handler --- diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 26465b002..1922bf81b 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -407,7 +407,6 @@ int pgp_class_application_handler(struct Body *m, struct State *s) long bytes; LOFF_T last_pos, offset; char buf[HUGE_STRING]; - char pgpoutfile[PATH_MAX]; char pgperrfile[PATH_MAX]; char tmpfname[PATH_MAX]; FILE *pgpout = NULL, *pgpin = NULL, *pgperr = NULL; @@ -510,17 +509,14 @@ int pgp_class_application_handler(struct Body *m, struct State *s) /* Invoke PGP if needed */ if (!clearsign || (s->flags & MUTT_VERIFY)) { - mutt_mktemp(pgpoutfile, sizeof(pgpoutfile)); - pgpout = mutt_file_fopen(pgpoutfile, "w+"); + pgpout = mutt_file_mkstemp(); if (!pgpout) { - mutt_perror(pgpoutfile); + mutt_perror("mutt_file_mkstemp() failed!"); rc = -1; goto out; } - unlink(pgpoutfile); - mutt_mktemp(pgperrfile, sizeof(pgperrfile)); if ((pgperr = mutt_file_fopen(pgperrfile, "w+")) == NULL) {