X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Frfc3676.c;h=68bf1f5c6fb8598e0a99dccdb5fe428d69f78db9;hp=404b02b419e2f085ef57f63da32f4c39ce9c97b7;hb=81efbf8081bad2eed7ad07209b301ca35fe183e8;hpb=f288d1771c814e6104da83e6f0f1761a40de1224 diff --git a/lib-mime/rfc3676.c b/lib-mime/rfc3676.c index 404b02b..68bf1f5 100644 --- a/lib-mime/rfc3676.c +++ b/lib-mime/rfc3676.c @@ -224,20 +224,21 @@ void rfc3676_space_stuff (HEADER* hdr) { if ((in = safe_fopen (hdr->content->filename, "r")) == NULL) return; - mutt_mktemp (tmpf); - if ((out = safe_fopen (tmpf, "w+")) == NULL) { - fclose (in); + + out = m_tempfile(tmpf, sizeof(tmpf), NONULL(Tempdir), NULL); + if (!out) { + m_fclose(&in); return; } - while (fgets (buf, sizeof (buf), in)) { + while (fgets(buf, sizeof (buf), in)) { if (m_strncmp("From ", buf, 4) == 0 || buf[0] == ' ') { fputc (' ', out); } fputs (buf, out); } - fclose (in); - fclose (out); + m_fclose(&in); + m_fclose(&out); mutt_set_mtime (hdr->content->filename, tmpf); unlink (hdr->content->filename); m_strreplace(&hdr->content->filename, tmpf);