X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=nntp%2Fnntp.c;h=a2388d9bfa54989af074e1919b67454f8b409544;hb=3766db5f849cea008b1cd3d532c712aeb17aa062;hp=e24857a1b222c9f07260b19fefced8da6fbd9f1b;hpb=ac1ea3143e61def7fc9000bee6d0d59d56c5b997;p=apps%2Fmadmutt.git diff --git a/nntp/nntp.c b/nntp/nntp.c index e24857a..a2388d9 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -14,10 +14,10 @@ #include #include #include +#include #include "mutt.h" #include "sort.h" -#include "mx.h" #include "nntp.h" #include "buffy.h" @@ -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",