Shell: shell.c Use IN_RANGE macro from util.h
Change an occurence of `in_range` to use the IN_RANGE macro. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
9a3a2424e1
commit
555f15deaa
1 changed files with 1 additions and 1 deletions
|
@ -539,7 +539,7 @@ static int exec_cmd(const struct shell *shell, size_t argc, const char **argv,
|
|||
uint8_t opt8 = shell->ctx->active_cmd.args.optional;
|
||||
uint32_t opt = (opt8 == SHELL_OPT_ARG_CHECK_SKIP) ?
|
||||
UINT16_MAX : opt8;
|
||||
bool in_range = (argc >= mand) && (argc <= (mand + opt));
|
||||
const bool in_range = IN_RANGE(argc, mand, mand + opt);
|
||||
|
||||
/* Check if argc is within allowed range */
|
||||
ret_val = cmd_precheck(shell, in_range);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue