Skip to content

Commit 049b67a

Browse files
edersondisouzanashif
authored andcommitted
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 <[email protected]>
1 parent 6c25136 commit 049b67a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/shell/backends/shell_telnet.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static void telnet_reply_dont_command(struct telnet_simple_command *cmd)
9999
{
100100
switch (cmd->opt) {
101101
case NVT_OPT_ECHO:
102+
{
102103
int ret = telnet_echo_set(sh_telnet->shell_context, false);
103104

104105
if (ret >= 0) {
@@ -107,6 +108,7 @@ static void telnet_reply_dont_command(struct telnet_simple_command *cmd)
107108
cmd->op = NVT_CMD_WILL;
108109
}
109110
break;
111+
}
110112
default:
111113
cmd->op = NVT_CMD_WONT;
112114
break;
@@ -123,6 +125,7 @@ static void telnet_reply_do_command(struct telnet_simple_command *cmd)
123125
cmd->op = NVT_CMD_WILL;
124126
break;
125127
case NVT_OPT_ECHO:
128+
{
126129
int ret = telnet_echo_set(sh_telnet->shell_context, true);
127130

128131
if (ret >= 0) {
@@ -131,6 +134,7 @@ static void telnet_reply_do_command(struct telnet_simple_command *cmd)
131134
cmd->op = NVT_CMD_WONT;
132135
}
133136
break;
137+
}
134138
default:
135139
cmd->op = NVT_CMD_WONT;
136140
break;

0 commit comments

Comments
 (0)