X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=nntp%2Fnntp.c;h=a2388d9bfa54989af074e1919b67454f8b409544;hb=3766db5f849cea008b1cd3d532c712aeb17aa062;hp=2141454cf26469bad330fb80c716d79b0045b72a;hpb=8476307969a605bea67f6b702b0c1e7a52038bed;p=apps%2Fmadmutt.git diff --git a/nntp/nntp.c b/nntp/nntp.c index 2141454..a2388d9 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -437,8 +437,8 @@ static int nntp_read_header (CONTEXT * ctx, const char *msgid, 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) @@ -915,12 +915,11 @@ int nntp_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) 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",