aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-01-07 12:29:10 -0500
committerDave Wallace <dwallacelf@gmail.com>2020-08-12 14:37:52 +0000
commit756437e6f2b4f9e7c5162ea861d7d446b20623e9 (patch)
tree804ed1d6c31c61430ab31132e9a2e563faa1c08e /src
parentda99771dfe04b56ea053178af0d8fec40201c69f (diff)
vlib: fix coverity warning / real bug
The path must be next-to-impossible to hit, because the code has been wrong for at least 5 years. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I23b8c4e1631827e7931f353c561c1e19c596c598 (cherry picked from commit 5c944eef7012e7c5b363399ed92966fb659196b7)
Diffstat (limited to 'src')
-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 c1cab16fe01..300d11f65cf 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -1308,7 +1308,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;
}