Message ID | 20240704180752.94264-3-r.smirnov@omp.ru |
---|---|
State | Superseded |
Headers | show |
Series | fix errors found by SVACE static analyzer #2 | expand |
diff --git a/src/shared/shell.c b/src/shared/shell.c index add4fa131..ea0985815 100644 --- a/src/shared/shell.c +++ b/src/shared/shell.c @@ -1333,7 +1333,7 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt) } } - if (opt) { + if (opt && index >= offset) { if (c != opt->options[index - offset].val) { usage(argc, argv, opt); exit(EXIT_SUCCESS);