subsys/shell/backends: Fix shell_telnet.c build with clang

It declares a variable inside a switch statement without brackets to
properly delimit the scope, making clang barf. This patch adds them.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
This commit is contained in:
Ederson de Souza 2023-11-03 16:12:58 -07:00 committed by Anas Nashif
commit 049b67aca9

View file

@ -99,6 +99,7 @@ static void telnet_reply_dont_command(struct telnet_simple_command *cmd)
{ {
switch (cmd->opt) { switch (cmd->opt) {
case NVT_OPT_ECHO: case NVT_OPT_ECHO:
{
int ret = telnet_echo_set(sh_telnet->shell_context, false); int ret = telnet_echo_set(sh_telnet->shell_context, false);
if (ret >= 0) { if (ret >= 0) {
@ -107,6 +108,7 @@ static void telnet_reply_dont_command(struct telnet_simple_command *cmd)
cmd->op = NVT_CMD_WILL; cmd->op = NVT_CMD_WILL;
} }
break; break;
}
default: default:
cmd->op = NVT_CMD_WONT; cmd->op = NVT_CMD_WONT;
break; break;
@ -123,6 +125,7 @@ static void telnet_reply_do_command(struct telnet_simple_command *cmd)
cmd->op = NVT_CMD_WILL; cmd->op = NVT_CMD_WILL;
break; break;
case NVT_OPT_ECHO: case NVT_OPT_ECHO:
{
int ret = telnet_echo_set(sh_telnet->shell_context, true); int ret = telnet_echo_set(sh_telnet->shell_context, true);
if (ret >= 0) { if (ret >= 0) {
@ -131,6 +134,7 @@ static void telnet_reply_do_command(struct telnet_simple_command *cmd)
cmd->op = NVT_CMD_WONT; cmd->op = NVT_CMD_WONT;
} }
break; break;
}
default: default:
cmd->op = NVT_CMD_WONT; cmd->op = NVT_CMD_WONT;
break; break;