summaryrefslogtreecommitdiff
path: root/rpmio/rgetopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'rpmio/rgetopt.c')
-rw-r--r--rpmio/rgetopt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/rpmio/rgetopt.c b/rpmio/rgetopt.c
index f789fa8fe..b14366a8a 100644
--- a/rpmio/rgetopt.c
+++ b/rpmio/rgetopt.c
@@ -28,6 +28,7 @@ int rgetopt(int argc, char * const argv[], const char *opts,
optind = 0;
#else
optind = 1;
+ optarg = NULL;
#endif
while ((c = getopt(argc, argv, opts)) != -1) {
@@ -39,6 +40,7 @@ int rgetopt(int argc, char * const argv[], const char *opts,
rc = -1;
break;
}
+ optarg = NULL;
}
return (rc < 0) ? -optopt : optind;
}