else
mutt_perror(fpin ? tempfile : a->filename);
- if (fpin)
- fclose (fpin);
- if (fpout)
- fclose (fpout);
+ m_fclose(&fpin);
+ m_fclose(&fpout);
return a->unlink ? 0 : -1;
}
goto bailout;
}
mutt_copy_stream (fp, tfp);
- fclose (fp);
- fclose (tfp);
+ m_fclose(&fp);
+ m_fclose(&tfp);
mutt_unlink (a->filename);
if (mutt_rename_file (tempfile, a->filename) != 0) {
mutt_perror (_("Failure to rename file."));
fseeko ((s.fpin = fp), m->offset, 0);
mutt_decode_attachment (m, &s);
- if (fclose (s.fpout) != 0) {
+ if (m_fclose(&s.fpout) != 0) {
mutt_perror ("fclose");
return (-1);
}
}
- }
- else {
+ } else {
/* In send mode, just copy file */
FILE *ofp, *nfp;
if (stat (m->filename, &st) == -1) {
mutt_perror ("stat");
- fclose (s.fpout);
+ m_fclose(&s.fpout);
return (-1);
}
mutt_body_handler (m, &s);
- fclose (s.fpout);
+ m_fclose(&s.fpout);
if (fp == NULL) {
m->length = 0;
m->encoding = saved_encoding;
m->parts = saved_parts;
m->hdr = saved_hdr;
}
- fclose (s.fpin);
+ m_fclose(&s.fpin);
}
return (0);
p++;
}
}
- fclose (fp);
+ m_fclose(&fp);
return (found);
}