X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fslocal.c;h=37173f65b29b32c03f72d8d6564481c0143da253;hb=56a34bc502bde807ab722ee5f20d4db2901a5b23;hp=4a8875e7c2cbbe8054f97c82eb6fb284ea200139;hpb=c79c37f2b6e647212c36b63841a4628af01c774a;p=mmh diff --git a/uip/slocal.c b/uip/slocal.c index 4a8875e..37173f6 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -2,8 +2,6 @@ /* * slocal.c -- asynchronously filter and deliver new mail * - * $Id$ - * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -1274,12 +1272,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)