]> granicus.if.org Git - neomutt/commitdiff
Remove tempfile from pgp_find_hash
authorMarco Sirabella <marco@sirabella.org>
Fri, 22 Jun 2018 18:44:40 +0000 (14:44 -0400)
committerRichard Russon <rich@flatcap.org>
Sat, 23 Jun 2018 14:52:17 +0000 (15:52 +0100)
ncrypt/pgpmicalg.c

index 64c8ad3af2c8ee56fc921898bce02524c89ee605..a1dbfb6e961ea0d84c3ccfa087065192dfaa6c8b 100644 (file)
@@ -159,18 +159,15 @@ static short pgp_mic_from_packet(unsigned char *p, size_t len)
 
 static short pgp_find_hash(const char *fname)
 {
-  char tempfile[PATH_MAX];
   size_t l;
   short rc = -1;
 
-  mutt_mktemp(tempfile, sizeof(tempfile));
-  FILE *out = mutt_file_fopen(tempfile, "w+");
+  FILE *out = mutt_file_mkstemp();
   if (!out)
   {
-    mutt_perror(tempfile);
+    mutt_perror("mutt_file_mkstemp() failed!");
     goto bye;
   }
-  unlink(tempfile);
 
   FILE *in = fopen(fname, "r");
   if (!in)