1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +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

@ -505,7 +505,7 @@ main(int argc, char *argv[])
usage(stderr, EXIT_FAILURE);
case 'd':
if (directory == NULL)
directory = optarg;
directory = strdup(optarg);
else
{
(void) fprintf(stderr,
@ -516,7 +516,7 @@ main(int argc, char *argv[])
break;
case 'l':
if (lcltime == NULL)
lcltime = optarg;
lcltime = strdup(optarg);
else
{
(void) fprintf(stderr,
@ -527,7 +527,7 @@ main(int argc, char *argv[])
break;
case 'p':
if (psxrules == NULL)
psxrules = optarg;
psxrules = strdup(optarg);
else
{
(void) fprintf(stderr,
@ -538,7 +538,7 @@ main(int argc, char *argv[])
break;
case 'y':
if (yitcommand == NULL)
yitcommand = optarg;
yitcommand = strdup(optarg);
else
{
(void) fprintf(stderr,
@ -549,7 +549,7 @@ main(int argc, char *argv[])
break;
case 'L':
if (leapsec == NULL)
leapsec = optarg;
leapsec = strdup(optarg);
else
{
(void) fprintf(stderr,