1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-18 04:29:09 +03:00

In our source code, make a copy of getopt's 'optarg' string arguments,

rather than just storing a pointer.
This commit is contained in:
Bruce Momjian
2012-10-12 13:35:40 -04:00
parent a29f7ed554
commit 49ec613201
20 changed files with 89 additions and 89 deletions

View File

@@ -78,13 +78,13 @@ main(int argc, char *argv[])
switch (c)
{
case 'h':
host = optarg;
host = pg_strdup(optarg);
break;
case 'p':
port = optarg;
port = pg_strdup(optarg);
break;
case 'U':
username = optarg;
username = pg_strdup(optarg);
break;
case 'w':
prompt_password = TRI_NO;
@@ -99,7 +99,7 @@ main(int argc, char *argv[])
quiet = true;
break;
case 'd':
dbname = optarg;
dbname = pg_strdup(optarg);
break;
case 'a':
alldb = true;
@@ -108,13 +108,13 @@ main(int argc, char *argv[])
syscatalog = true;
break;
case 't':
table = optarg;
table = pg_strdup(optarg);
break;
case 'i':
index = optarg;
index = pg_strdup(optarg);
break;
case 2:
maintenance_db = optarg;
maintenance_db = pg_strdup(optarg);
break;
default:
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);