X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=postpone.c;h=5fda6cec492ad0cd7ad99e5913c3017709a670da;hp=7198d53528d76c870f19c97b718579d74ed60aa5;hb=81efbf8081bad2eed7ad07209b301ca35fe183e8;hpb=ac1ea3143e61def7fc9000bee6d0d59d56c5b997 diff --git a/postpone.c b/postpone.c index 7198d53..5fda6ce 100644 --- a/postpone.c +++ b/postpone.c @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -22,7 +23,6 @@ #include "handler.h" #include "sort.h" #include "thread.h" -#include "mx.h" #include #include @@ -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); @@ -622,7 +621,7 @@ int mutt_prepare_template (FILE * fp, CONTEXT * ctx, HEADER * newhdr, else mutt_decode_attachment (b, &s); - if (safe_fclose (&s.fpout) != 0) + if (m_fclose(&s.fpout) != 0) goto bail; m_strreplace(&b->filename, file); @@ -656,7 +655,7 @@ bail: /* that's it. */ if (bfp != fp) - fclose (bfp); + m_fclose(&bfp); if (msg) mx_close_message (&msg);