Surely this temp buffer needn't be static.
authorTom Lane <[email protected]>
Fri, 22 Sep 2006 19:51:14 +0000 (19:51 +0000)
committerTom Lane <[email protected]>
Fri, 22 Sep 2006 19:51:14 +0000 (19:51 +0000)
src/bin/scripts/common.c

index 4b5f94b895a379a1318648248ac0fb1c6c1c62a5..3eb972a8a65d5590927790c573b5424b7263c352 100644 (file)
@@ -206,14 +206,15 @@ executeCommand(PGconn *conn, const char *query,
 bool
 yesno_prompt(const char *question)
 {
-       static char prompt[128];
+       char prompt[256];
 
        for (;;)
        {
                char *resp;
 
                /* translator: This is a question followed by the translated options for "yes" and "no". */
-               snprintf(prompt, sizeof(prompt), _("%s (%s/%s) "), _(question), _(PG_YESLETTER), _(PG_NOLETTER));
+               snprintf(prompt, sizeof(prompt), _("%s (%s/%s) "),
+                                _(question), _(PG_YESLETTER), _(PG_NOLETTER));
                resp = simple_prompt(prompt, 1, true);
 
                if (strcmp(resp, _(PG_YESLETTER)) == 0)
@@ -221,6 +222,7 @@ yesno_prompt(const char *question)
                else if (strcmp(resp, _(PG_NOLETTER)) == 0)
                        return false;
 
-               printf(_("Please answer \"%s\" or \"%s\".\n"), _(PG_YESLETTER), _(PG_NOLETTER));
+               printf(_("Please answer \"%s\" or \"%s\".\n"),
+                          _(PG_YESLETTER), _(PG_NOLETTER));
        }
 }