]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_list.c: fix option handling
authorMarek Schimara <Marek.Schimara@bull.net>
Thu, 25 Aug 2016 14:35:49 +0000 (16:35 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Fri, 26 Aug 2016 07:11:02 +0000 (09:11 +0200)
src/rrd_list.c

index bb583655150aae9b8a70b87942e2d135bd2a5424..402157ed5ea1d02bacf43226591c5595620c99bc 100644 (file)
@@ -38,7 +38,7 @@ char *rrd_list(int argc, char **argv)
                        if (opt_daemon != NULL) {
                                free (opt_daemon);
                        }
-                       opt_daemon = strdup (optarg);
+                       opt_daemon = strdup (options.optarg);
                        if (opt_daemon == NULL)
                        {
                                rrd_set_error ("strdup failed.");
@@ -71,7 +71,7 @@ char *rrd_list(int argc, char **argv)
 
        }
 
-       if ((argc - optind) != 1) {
+       if ((argc - options.optind) != 1) {
                rrd_set_error ("Usage: rrdtool %s [--daemon <addr> [--noflush]] <directory>",
                 argv[0]);
 
@@ -97,7 +97,7 @@ char *rrd_list(int argc, char **argv)
        rrdc_connect (opt_daemon);
 
        if (rrdc_is_connected (opt_daemon)) {
-               list = rrdc_list(argv[optind]);
+               list = rrdc_list(argv[options.optind]);
                rrdc_disconnect();
 
        } else {
@@ -109,7 +109,7 @@ char *rrd_list(int argc, char **argv)
                                fprintf(stderr, ": %s", err);
                        fprintf(stderr, "\n");
                }
-               list = rrd_list_r(argv[optind]);
+               list = rrd_list_r(argv[options.optind]);
        }
 
        if (opt_daemon != NULL) {