X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fslocal.c;h=f24228af7b9dbdb5ebcb5a679e79e035396c50e7;hb=2f689a1cb907a5de04e6d39ffd217a69af3216c7;hp=4a8875e7c2cbbe8054f97c82eb6fb284ea200139;hpb=352fe458a57061db81240c19fa4b356c7448463b;p=mmh diff --git a/uip/slocal.c b/uip/slocal.c index 4a8875e..f24228a 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1274,12 +1274,12 @@ copy_message (int qd, char *tmpfil, int fold) int i, first = 1, fd1, fd2; char buffer[BUFSIZ]; FILE *qfp, *ffp; + char *tfile = NULL; - strcpy (tmpfil, m_tmpfil (invo_name)); - - /* open temporary file to put message in */ - if ((fd1 = open (tmpfil, O_RDWR | O_CREAT | O_TRUNC, 0600)) == -1) - return -1; + tfile = m_mktemp2(NULL, invo_name, &fd1, NULL); + if (tfile == NULL) return -1; + fchmod(fd1, 0600); + strncpy (tmpfil, tfile, BUFSIZ); if (!fold) { while ((i = read (qd, buffer, sizeof(buffer))) > 0)