tmphdr->env = envelope_new();
mutt_make_forward_subject (tmphdr->env, Context, parent);
- mutt_mktemp (tmpbody);
- if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL) {
- mutt_error (_("Can't open temporary file %s."), tmpbody);
+ tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL);
+ if (!tmpfp) {
+ mutt_error(_("Could not create temporary file"));
return;
}
/* no MIME encapsulation */
- mutt_mktemp (tmpbody);
- if (!(tmpfp = safe_fopen (tmpbody, "w"))) {
- mutt_error (_("Can't create %s."), tmpbody);
+ tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL);
+ if (!tmpfp) {
+ mutt_error(_("Could not create temporary file"));
header_delete(&tmphdr);
return;
}
return;
}
- mutt_mktemp (tmpbody);
- if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL) {
- mutt_error (_("Can't create %s."), tmpbody);
+ tmpfp = m_tempfile(tmpbody, sizeof(tmpbody), NONULL(Tempdir), NULL);
+ if (!tmpfp) {
+ mutt_error(_("Could not create temporary file"));
header_delete(&tmphdr);
return;
}