X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=handler.c;h=cc0a3c1184e433ec28aa766acf929119ad629c41;hp=e49d973a21380bc68681a1fdc65728939fd421bd;hb=8eeb8c4bac4a99f7f61dd67105b3cdf35925d036;hpb=124aee0f600ef550fd1c73e8d7a60556f4f6afd0 diff --git a/handler.c b/handler.c index e49d973..cc0a3c1 100644 --- a/handler.c +++ b/handler.c @@ -1388,10 +1388,9 @@ int mutt_body_handler (BODY * b, STATE * s) if (!plaintext) { /* decode to a tempfile, saving the original destination */ fp = s->fpout; - mutt_mktemp (tempfile); - if ((s->fpout = safe_fopen (tempfile, "w")) == NULL) { + s->fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + if (!s->fpout) { mutt_error _("Unable to open temporary file!"); - goto bail; } /* decoding the attachment changes the size and offset, so save a copy @@ -1407,9 +1406,9 @@ int mutt_body_handler (BODY * b, STATE * s) s->prefix = NULL; decode = 1; - } - else + } else { b->type = TYPETEXT; + } mutt_decode_attachment (b, s);