Skip to content

Commit

Permalink
subsys/shell/backends: Fix shell_telnet.c build with clang
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
edersondisouza authored and nashif committed Nov 4, 2023
1 parent 6c25136 commit 049b67a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subsys/shell/backends/shell_telnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static void telnet_reply_dont_command(struct telnet_simple_command *cmd)
{
switch (cmd->opt) {
case NVT_OPT_ECHO:
{
int ret = telnet_echo_set(sh_telnet->shell_context, false);

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

if (ret >= 0) {
Expand All @@ -131,6 +134,7 @@ static void telnet_reply_do_command(struct telnet_simple_command *cmd)
cmd->op = NVT_CMD_WONT;
}
break;
}
default:
cmd->op = NVT_CMD_WONT;
break;
Expand Down

0 comments on commit 049b67a

Please sign in to comment.