telnet_server: fix scan-build warning
fix "Declared variable-length array (VLA) has zero size" warning raised in .../src/server/telnet_server.c:633:2: Change-Id: Icff5228b02790c472b212a86a3849b1a3df98fdb Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6565 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
7cc79a8d62
commit
d1b882f2c0
|
@ -615,7 +615,11 @@ static void telnet_auto_complete(struct connection *connection)
|
||||||
while ((usr_cmd_pos < t_con->line_cursor) && isspace(t_con->line[usr_cmd_pos]))
|
while ((usr_cmd_pos < t_con->line_cursor) && isspace(t_con->line[usr_cmd_pos]))
|
||||||
usr_cmd_pos++;
|
usr_cmd_pos++;
|
||||||
|
|
||||||
/* user command length */
|
/* check user command length */
|
||||||
|
if (t_con->line_cursor < usr_cmd_pos) {
|
||||||
|
telnet_bell(connection);
|
||||||
|
return;
|
||||||
|
}
|
||||||
size_t usr_cmd_len = t_con->line_cursor - usr_cmd_pos;
|
size_t usr_cmd_len = t_con->line_cursor - usr_cmd_pos;
|
||||||
|
|
||||||
/* optimize multiple spaces in the user command,
|
/* optimize multiple spaces in the user command,
|
||||||
|
|
Loading…
Reference in New Issue