X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fforw.c;h=7892d7f57240f2c9fe0b7627ec1a0c115f3740c0;hb=03bf20a885b3953a0385e814ba4e0196b46f6159;hp=2d4f2d53deb22b2b2b75d0c9cea2eb35be81d3a1;hpb=38615191e71744b066425e0c44412b62dbe49cc2;p=mmh diff --git a/uip/forw.c b/uip/forw.c index 2d4f2d5..7892d7f 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -650,10 +650,11 @@ build_form (char *form, char *digest, int volume, int issue) int fmtsize; register char *nfs; char *line, tmpfil[BUFSIZ]; - register FILE *tmp; + FILE *tmp; register struct comp *cptr; struct format *fmt; int dat[5]; + char *cp = NULL; /* Get new format string */ nfs = new_fs (form, NULL, NULL); @@ -675,9 +676,9 @@ build_form (char *form, char *digest, int volume, int issue) dat[3] = fmtsize; dat[4] = 0; - strncpy (tmpfil, m_tmpfil (invo_name), sizeof(tmpfil)); - if ((tmp = fopen (tmpfil, "w+")) == NULL) - adios (tmpfil, "unable to create"); + cp = m_mktemp2(NULL, invo_name, NULL, &tmp); + if (cp == NULL) adios("forw", "unable to create temporary file"); + strncpy (tmpfil, cp, sizeof(tmpfil)); unlink (tmpfil); if ((in = dup (fileno (tmp))) == NOTOK) adios ("dup", "unable to");