mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +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:
@@ -82,13 +82,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;
|
||||
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
|
||||
quiet = true;
|
||||
break;
|
||||
case 'd':
|
||||
dbname = optarg;
|
||||
dbname = pg_strdup(optarg);
|
||||
break;
|
||||
case 'z':
|
||||
and_analyze = true;
|
||||
@@ -118,7 +118,7 @@ main(int argc, char *argv[])
|
||||
alldb = true;
|
||||
break;
|
||||
case 't':
|
||||
table = optarg;
|
||||
table = pg_strdup(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
full = true;
|
||||
@@ -127,7 +127,7 @@ main(int argc, char *argv[])
|
||||
verbose = true;
|
||||
break;
|
||||
case 2:
|
||||
maintenance_db = optarg;
|
||||
maintenance_db = pg_strdup(optarg);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
|
||||
|
Reference in New Issue
Block a user