X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=recvcmd.c;h=a8e4b6b27dcc44461ebd2507c2283b7a8edfb33a;hb=3766db5f849cea008b1cd3d532c712aeb17aa062;hp=cf0aa4f6c719e205fc2defe2c8a2ebe626b2184c;hpb=c8b8b9539aaf11b48c4c1e5baba434db09722111;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; }