Signed-off-by: Julien Danjou <julien@danjou.info>
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
char buf[LONG_STRING];
char *tempfile = NULL, *infile = NULL;
char *bodytext = NULL;
char buf[LONG_STRING];
char *tempfile = NULL, *infile = NULL;
char *bodytext = NULL;
if (!option (OPTNOCURSES))
mutt_flushinp ();
if (!option (OPTNOCURSES))
mutt_flushinp ();
- 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 (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);
if (!option (OPTNOCURSES))
mutt_endwin (NULL);
perror (tempfile);