summaryrefslogtreecommitdiff
path: root/src/timezone/zic.c
diff options
context:
space:
mode:
authorBruce Momjian2012-10-12 17:35:40 +0000
committerBruce Momjian2012-10-12 17:35:43 +0000
commit49ec613201b2e9debdf9e9ad9a2ad7c6c8083729 (patch)
tree16626d363ecc7b021b2fda82bb27b811e2335c09 /src/timezone/zic.c
parenta29f7ed5544ef583747c0dcc3fc2afac1fb191ef (diff)
In our source code, make a copy of getopt's 'optarg' string arguments,
rather than just storing a pointer.
Diffstat (limited to 'src/timezone/zic.c')
-rw-r--r--src/timezone/zic.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index 8a95d6ac3f..0aa90ebfca 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -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,