X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/55f65ae2d3baf60396d3359db952460939de03ca..4e23ddd4d595d50de4b7fa0ab6bf3533bcf42723:/uip/prompter.c?ds=inline diff --git a/uip/prompter.c b/uip/prompter.c index 05f8348c..afa81f5f 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -72,10 +72,10 @@ main (int argc, char **argv) int doteof = 0, fdi, fdo, i, state; char *cp, *drft = NULL, *erasep = NULL; char *killp = NULL, name[NAMESZ], field[BUFSIZ]; - char buffer[BUFSIZ], tmpfil[BUFSIZ]; + char buffer[BUFSIZ]; char **arguments, **argp; FILE *in, *out; - char *tfile = NULL; + char *tmpfil; m_getfld_state_t gstate = 0; #ifdef LOCALE @@ -154,10 +154,9 @@ main (int argc, char **argv) if ((in = fopen (drft, "r")) == NULL) adios (drft, "unable to open"); - tfile = m_mktemp2(NULL, invo_name, NULL, &out); - if (tfile == NULL) adios("prompter", "unable to create temporary file"); + tmpfil = m_mktemp2(NULL, invo_name, NULL, &out); + if (tmpfil == NULL) adios("prompter", "unable to create temporary file"); chmod (tmpfil, 0600); - strncpy (tmpfil, tfile, sizeof(tmpfil)); /* * Are we changing the kill or erase character?