Use m_tempfile and better errors msg
[apps/madmutt.git] / postpone.c
index d8d8cf5..5fda6ce 100644 (file)
@@ -604,11 +604,10 @@ int mutt_prepare_template (FILE * fp, CONTEXT * ctx, HEADER * newhdr,
       parameter_delval(&b->parameter, "x-mutt-noconv");
     }
 
-    mutt_adv_mktemp (NULL, file, sizeof (file));
-    if ((s.fpout = safe_fopen (file, "w")) == NULL)
+    s.fpout = m_tempfile(file, sizeof(file), NONULL(Tempdir), file);
+    if (!s.fpout)
       goto bail;
 
-
     if (mutt_is_application_pgp (b) & (ENCRYPT | SIGN)) {
 
       mutt_body_handler (b, &s);