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"));
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;
}