char buf[LONG_STRING];
char *tempfile = NULL, *infile = NULL;
char *bodytext = NULL;
+ FILE *fout;
if (!option (OPTNOCURSES))
mutt_flushinp ();
else
fin = NULL;
- mutt_mktemp (buf);
- tempfile = m_strdup(buf);
-
if (draftFile)
msg->env = mutt_read_rfc822_header (fin, NULL, 1, 0);
/* is the following if still needed? */
- if (tempfile) {
- FILE *fout;
+ fout = m_tempfile(buf, sizeof(buf), NONULL(Tempdir), NULL);
+ tempfile = m_strdup(buf);
- if ((fout = safe_fopen (tempfile, "w")) == NULL) {
+ if (tempfile) {
+ if (!fout) {
if (!option (OPTNOCURSES))
mutt_endwin (NULL);
perror (tempfile);