X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fprompter.c;h=7c28aeced74d7ba2db8bbff5ebe9cfc43b43aacf;hb=f480c03187724e54e5391ee61b810827da319a6c;hp=35f6860a4ac49536a06f085991d56daf24b09294;hpb=38615191e71744b066425e0c44412b62dbe49cc2;p=mmh diff --git a/uip/prompter.c b/uip/prompter.c index 35f6860..7c28aec 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -2,8 +2,6 @@ /* * prompter.c -- simple prompting editor front-end * - * $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. @@ -108,6 +106,7 @@ main (int argc, char **argv) char buffer[BUFSIZ], tmpfil[BUFSIZ]; char **arguments, **argp; FILE *in, *out; + char *tfile = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); @@ -185,10 +184,10 @@ main (int argc, char **argv) if ((in = fopen (drft, "r")) == NULL) adios (drft, "unable to open"); - strncpy (tmpfil, m_tmpfil (invo_name), sizeof(tmpfil)); - if ((out = fopen (tmpfil, "w")) == NULL) - adios (tmpfil, "unable to create"); + tfile = m_mktemp2(NULL, invo_name, NULL, &out); + if (tfile == NULL) adios("prompter", "unable to create temporary file"); chmod (tmpfil, 0600); + strncpy (tmpfil, tfile, sizeof(tmpfil)); /* * Are we changing the kill or erase character?