int ret;
HEADER *h = ctx->hdrs[ctx->msgcount];
- mutt_mktemp (tempfile);
- if (!(f = safe_fopen (tempfile, "w+")))
+ f = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!f)
return -1;
if (!msgid)
p_delete(&cache->path);
cache->index = ctx->hdrs[msgno]->index;
- mutt_mktemp (path);
- cache->path = m_strdup(path);
- if (!(msg->fp = safe_fopen (path, "w+"))) {
- p_delete(&cache->path);
+ msg->fp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL);
+ if (!msg->fp) {
return -1;
}
+ cache->path = m_strdup(path);
if (ctx->hdrs[msgno]->article_num == 0)
snprintf (buf, sizeof (buf), "ARTICLE %s\r\n",