From: Marco Sirabella Date: Fri, 22 Jun 2018 18:44:40 +0000 (-0400) Subject: Remove tempfile from pgp_find_hash X-Git-Tag: neomutt-20180716~24^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34f9556b4f02dbf4c4a3e3bd3cf98ef624bf59bb;p=neomutt Remove tempfile from pgp_find_hash --- diff --git a/ncrypt/pgpmicalg.c b/ncrypt/pgpmicalg.c index 64c8ad3af..a1dbfb6e9 100644 --- a/ncrypt/pgpmicalg.c +++ b/ncrypt/pgpmicalg.c @@ -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)