summaryrefslogtreecommitdiffstats
path: root/src/vlib/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/cli.c')
-rw-r--r--src/vlib/cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c
index 467d1f7b906..bb6c5746537 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -1217,7 +1217,7 @@ add_sub_command (vlib_cli_main_t * cm, uword parent_index, uword child_index)
vec_len (p->sub_rules));
vec_add2 (p->sub_rules, sr, 1);
sr->name = sub_name;
- sr->rule_index = q[0];
+ sr->rule_index = sr - p->sub_rules;
sr->command_index = child_index;
return;
}