X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-crypt%2Fpgpkey.c;h=16d9e4cb6b62c357c18f0fe6a77211064b7e85c2;hb=c8e3d1cce2a8af0b4725e1a751f8795bf04487da;hp=a3b3ca24b3c23c848452c2559404d48940228c6a;hpb=9ed7a487e3a922f2cbb222961c2c9710c3a65f91;p=apps%2Fmadmutt.git diff --git a/lib-crypt/pgpkey.c b/lib-crypt/pgpkey.c index a3b3ca2..16d9e4c 100644 --- a/lib-crypt/pgpkey.c +++ b/lib-crypt/pgpkey.c @@ -500,13 +500,14 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, address_t * p, const char *s) case OP_VERIFY_KEY: - mutt_mktemp (tempfile); if ((devnull = fopen ("/dev/null", "w")) == NULL) { /* __FOPEN_CHECKED__ */ mutt_perror (_("Can't open /dev/null")); break; } - if ((fp = safe_fopen (tempfile, "w")) == NULL) { + + fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + if (!fp) { m_fclose(&devnull); mutt_perror (_("Can't create temporary file")); @@ -682,13 +683,14 @@ BODY *pgp_make_key_attachment (char *tempf) pgp_free_key (&key); if (!tempf) { - mutt_mktemp (tempfb); + tempfp = m_tempfile (tempfb, sizeof(tempfb), NONULL(Tempdir), NULL); tempf = tempfb; + } else { + tempfp = safe_fopen(tempf, "a"); } - if ((tempfp = safe_fopen (tempf, tempf == tempfb ? "w" : "a")) == NULL) { + if (!tempfp) { mutt_perror (_("Can't create temporary file")); - return NULL; }