X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=recvcmd.c;h=a8e4b6b27dcc44461ebd2507c2283b7a8edfb33a;hb=7b392ef7b50798f9eb3e7c869e634c5fef0092d1;hp=cf0aa4f6c719e205fc2defe2c8a2ebe626b2184c;hpb=92f2fc3802e13a8eb0717123c588d855fa0de67f;p=apps%2Fmadmutt.git diff --git a/recvcmd.c b/recvcmd.c index cf0aa4f..a8e4b6b 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -443,9 +443,9 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, 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; } @@ -611,9 +611,9 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr __attribute__ ((unused) /* 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; } @@ -859,9 +859,9 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, 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; }