X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/afee8ed17a56617618fb7f963b111d7cf0fb56e7..43cfc6660af9677d520d578713f57ae0d8d1b81f:/uip/prompter.c?ds=inline diff --git a/uip/prompter.c b/uip/prompter.c index 563da058..7923e84b 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -10,8 +10,6 @@ #include #include #include -#include -#include #include #include @@ -74,15 +72,13 @@ 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 setlocale(LC_ALL, ""); -#endif invo_name = r1bindex (argv[0], '/'); /* read user profile/context */ @@ -156,10 +152,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?