- mutt_mktemp (tempfile);
- if (!(fp = safe_fopen (tempfile, "w+"))) {
- mutt_error (_("Could not create temporary file %s"), tempfile);
- mutt_sleep (2);
+ fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!fp) {
+ mutt_error(_("Could not create temporary file"));
+ mutt_sleep(2);