X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fimap.c;h=c214ddfe90f160bbb11608dc5214de4ae5b09f0c;hp=4b557fe84a0b2cac1f5778cd3b58c660723d0c2a;hb=7b392ef7b50798f9eb3e7c869e634c5fef0092d1;hpb=cef32312aa7c285411e817304de98f3873cba6be;ds=sidebyside diff --git a/imap/imap.c b/imap/imap.c index 4b557fe..c214ddf 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1598,15 +1598,16 @@ static int imap_open_new_message (MESSAGE * msg, CONTEXT * dest __attribute__ ((unused)), HEADER * hdr __attribute__ ((unused))) { - char tmp[_POSIX_PATH_MAX]; + char tmp[_POSIX_PATH_MAX]; - mutt_mktemp (tmp); - if ((msg->fp = safe_fopen (tmp, "w")) == NULL) { - mutt_perror (tmp); - return (-1); - } - msg->path = m_strdup(tmp); - return 0; + msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(Tempdir), NULL); + if (!msg->fp) { + mutt_perror(tmp); + return -1; + } + + msg->path = m_strdup(tmp); + return 0; } /* this ugly kludge is required since the last int to