]> granicus.if.org Git - neomutt/commitdiff
Remove pgpoutfile from pgp_class_application_handler
authorMarco Sirabella <marco@sirabella.org>
Fri, 22 Jun 2018 16:01:13 +0000 (12:01 -0400)
committerRichard Russon <rich@flatcap.org>
Sat, 23 Jun 2018 14:05:53 +0000 (15:05 +0100)
ncrypt/pgp.c

index 26465b002a84a50bedb0d26e1815f88ec8f6dae9..1922bf81b5c6a355cc53cdcd408a3ff779222c12 100644 (file)
@@ -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)
         {