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:
Emil Gydesen 2022-03-08 11:02:32 +01:00 committed by Maureen Helm
commit 555f15deaa

View file

@ -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);