]> granicus.if.org Git - sysstat/commitdiff
Small fix with sadc's option -S
authorSebastien GODARD <sysstat@users.noreply.github.com>
Thu, 8 May 2014 15:00:54 +0000 (17:00 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Thu, 8 May 2014 15:00:54 +0000 (17:00 +0200)
sadc was unable to read a list of comma separated values following
option -S. This is now fixed.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sadc.c

diff --git a/sadc.c b/sadc.c
index 28bc44da9aca39ae6f80f925b927a5c654c60c33..2a73caf72ecada8dac27772b24b0bfd1fdd5e76c 100644 (file)
--- a/sadc.c
+++ b/sadc.c
@@ -173,7 +173,7 @@ void parse_sadc_S_option(char *argv[], int opt)
                                collect_group_activities(G_DISK + G_XDISK, AO_F_DISK_PART);
                        }
                }
-               else if (strspn(argv[opt], DIGITS) == strlen(argv[opt])) {
+               else if (strspn(p, DIGITS) == strlen(p)) {
                        /*
                         * Although undocumented, option -S followed by a numerical value
                         * enables the user to select each activity that should be
@@ -183,7 +183,7 @@ void parse_sadc_S_option(char *argv[], int opt)
                         */
                        int act_id;
 
-                       act_id = atoi(argv[opt]);
+                       act_id = atoi(p);
                        if (act_id > 255) {
                                act_id >>= 8;
                                for (i = 0; i < NR_ACT; i++) {