X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fforw.c;h=7668b4d76ac82be3b8b0d247a8b94d0881771759;hb=f480c03187724e54e5391ee61b810827da319a6c;hp=17e78e981782ae09a824ae3e6e6387fa3c6ad24f;hpb=30fd2ad6d3eff3749b2ae99ec90d2215bf1b1aca;p=mmh diff --git a/uip/forw.c b/uip/forw.c index 17e78e9..7668b4d 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -2,8 +2,6 @@ /* * forw.c -- forward a message, or group of messages. * - * $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. @@ -444,7 +442,8 @@ try_it_again: done (0); what_now (ed, nedit, NOUSE, drft, NULL, 0, mp, anot ? "Forwarded" : NULL, inplace, cwd); - return done (1); + done (1); + return 1; } @@ -621,7 +620,7 @@ copy_draft (int out, char *digest, char *file, int volume, int issue, int dashst /* - * Create a mhn composition file for forwarding message. + * Create a mhbuild composition file for forwarding message. */ static void @@ -649,10 +648,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); @@ -674,9 +674,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");