int err = 0;
gpgme_data_t data;
- mutt_mktemp (tempfile);
- fptmp = safe_fopen (tempfile, "w+");
+ fptmp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
if (!fptmp) {
- mutt_perror (tempfile);
+ mutt_perror (_("Can't create temporary file"));
return NULL;
}
FILE *fp;
ssize_t nread = 0;
- mutt_mktemp (tempfile);
- fp = safe_fopen (tempfile, "w+");
+ fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
if (!fp) {
- mutt_perror (tempfile);
+ mutt_perror (_("Can't create temporary file"));
return NULL;
}
p_clear(&s, 1);
s.fpin = fpin;
- mutt_mktemp (tempfile);
- if (!(*fpout = safe_fopen (tempfile, "w+"))) {
- mutt_perror (tempfile);
+ *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!*fpout) {
+ mutt_perror (_("Can't create temporary file"));
return -1;
}
unlink (tempfile);
p_clear(&s, 1);
s.fpin = fpin;
fseeko (s.fpin, b->offset, 0);
- mutt_mktemp (tempfile);
- if (!(tmpfp = safe_fopen (tempfile, "w+"))) {
- mutt_perror (tempfile);
+ tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!tmpfp) {
+ mutt_perror (_("Can't create temporary file"));
return -1;
}
mutt_unlink (tempfile);
p_clear(&s, 1);
s.fpin = tmpfp;
s.fpout = 0;
- mutt_mktemp (tempfile);
- if (!(*fpout = safe_fopen (tempfile, "w+"))) {
- mutt_perror (tempfile);
+ *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!*fpout) {
+ mutt_perror (_("Can't create temporary file"));
return -1;
}
mutt_unlink (tempfile);
p_clear(&s, 1);
s.fpin = *fpout;
fseeko (s.fpin, bb->offset, 0);
- mutt_mktemp (tempfile);
- if (!(tmpfp = safe_fopen (tempfile, "w+"))) {
- mutt_perror (tempfile);
+ tmpfp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!tmpfp) {
+ mutt_perror (_("Can't create temporary file"));
return -1;
}
mutt_unlink (tempfile);
p_clear(&s, 1);
s.fpin = tmpfp;
s.fpout = 0;
- mutt_mktemp (tempfile);
- if (!(*fpout = safe_fopen (tempfile, "w+"))) {
- mutt_perror (tempfile);
+ *fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!*fpout) {
+ mutt_perror (_("Can't create temporary file"));
return -1;
}
mutt_unlink (tempfile);
/* Move forward to the application/pgp-encrypted body. */
a = a->next;
- mutt_mktemp (tempfile);
- if (!(fpout = safe_fopen (tempfile, "w+"))) {
+ fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!fpout) {
if (s->flags & M_DISPLAY)
state_attach_puts (_("[-- Error: could not create temporary file! "
"--]\n"), s);
int rc = 0;
a->warnsig = 0;
- mutt_mktemp (tempfile);
- if (!(fpout = safe_fopen (tempfile, "w+"))) {
+ fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!fpout) {
if (s->flags & M_DISPLAY)
state_attach_puts (_("[-- Error: could not create temporary file! "
"--]\n"), s);
gpgme_key_t k = NULL;
int maxdepth = 100;
- mutt_mktemp (tempfile);
- if (!(fp = safe_fopen (tempfile, "w"))) {
+ fp = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+ if (!fp) {
mutt_perror (_("Can't create temporary file"));
-
return;
}
mutt_message _("Collecting data...");