if (stat (a->filename, &st) == -1)
return -1;
- if ((fpin = fopen (a->filename, "r")) && (fpout = safe_fopen (tempfile, "w"))) { /* __FOPEN_CHECKED__ */
+ if ((fpin = fopen (a->filename, "r")) && (fpout = safe_fopen (tempfile, "w"))) {
mutt_copy_stream (fpin, fpout);
m_strreplace(&a->filename, tempfile);
a->unlink = 1;
int unlink_tempfile = 0;
int pagerfd = -1;
- is_message = mutt_is_message_type (a->type, a->subtype);
+ is_message = mutt_is_message_type(a);
if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase (a->hdr->security))
return (rc);
}
if (use_pager) {
- if (fp && !use_mailcap && a->filename) {
- /* recv case */
- m_strcpy(pagerfile, sizeof(pagerfile), a->filename);
- pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(Tempdir), pagerfile);
- } else {
- pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(Tempdir), NULL);
- }
+ /* recv case */
+ pagerfd = m_tempfd(pagerfile, sizeof(pagerfile), NONULL(Tempdir),
+ fp && !use_mailcap ? a->filename : NULL);
}
if (use_mailcap) {
* as safe_fopen returns w/ an error if path exists
*/
if (flags == M_SAVE_OVERWRITE)
- return fopen (path, "w"); /* __FOPEN_CHECKED__ */
+ return fopen (path, "w");
return safe_fopen (path, "w");
}
m->hdr &&
m->encoding != ENCBASE64 &&
m->encoding != ENCQUOTEDPRINTABLE &&
- mutt_is_message_type (m->type, m->subtype)) {
+ mutt_is_message_type(m)) {
/* message type attachments are written to mail folders. */
char buf[HUGE_STRING];
if (flags == M_SAVE_APPEND)
s.fpout = fopen (path, "a");
- else if (flags == M_SAVE_OVERWRITE)
- s.fpout = safe_fopen (path, "w"); /* __FOPEN_CHECKED__ */
else
s.fpout = safe_fopen (path, "w");