diff options
Diffstat (limited to 'tools/perf/util/parse-options.c')
-rw-r--r-- | tools/perf/util/parse-options.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c index 4a015f77e2b5..4ee9a86705ed 100644 --- a/tools/perf/util/parse-options.c +++ b/tools/perf/util/parse-options.c | |||
@@ -510,8 +510,10 @@ int parse_options_subcommand(int argc, const char **argv, const struct option *o | |||
510 | } | 510 | } |
511 | exit(130); | 511 | exit(130); |
512 | case PARSE_OPT_LIST_SUBCMDS: | 512 | case PARSE_OPT_LIST_SUBCMDS: |
513 | for (int i = 0; subcommands[i]; i++) | 513 | if (subcommands) { |
514 | printf("%s ", subcommands[i]); | 514 | for (int i = 0; subcommands[i]; i++) |
515 | printf("%s ", subcommands[i]); | ||
516 | } | ||
515 | exit(130); | 517 | exit(130); |
516 | default: /* PARSE_OPT_UNKNOWN */ | 518 | default: /* PARSE_OPT_UNKNOWN */ |
517 | if (ctx.argv[0][1] == '-') { | 519 | if (ctx.argv[0][1] == '-') { |