zephyr/subsys/shell
Maksim Masalski a4c0810aa0 shell: changed dead code part in function buffer_trim()
According to the Coverity issue 190614 (github issue #12319)
Fix for logically dead code in function buffer_trim
Before while execution cannot reach this statement: buff[0] = '\0';

Tested and noticed that part of code is unnecessary inside of while
For the test, I made the same function in CodeBlocks and send to it
string to detect and delete whitespaces. After deletion of dead code
part, I tested function again, it works.

Function buffer_trim first detects whitespace characters in the end
of the string using first while, then it adds '\0' to the end
of the string to mark that string has new end after all whitespace
characters. Second while finds whitespaces at the beginning
of the string and counts how many whitespaces it found.
In the end using if counted whitespaces are removing from the
string.

Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-02-26 02:26:52 +01:00
..
modules shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE 2019-02-20 07:31:35 -05:00
CMakeLists.txt shell: removing legacy shell 2019-01-16 21:35:36 -05:00
Kconfig shell: improved shell_prompt_change function 2019-02-08 14:51:52 -05:00
Kconfig.backends dts: Convert CONFIG_ to DT_ symbols for chosen props 2019-02-08 11:41:26 -06:00
Kconfig.template.shell_log_queue_size shell: Improve handling of log messages 2018-12-19 14:37:00 +01:00
Kconfig.template.shell_log_queue_timeout shell: Improve handling of log messages 2018-12-19 14:37:00 +01:00
shell_cmds.c shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE 2019-02-20 07:31:35 -05:00
shell_dummy.c shell: Improve handling of log messages 2018-12-19 14:37:00 +01:00
shell_fprintf.c shell: parsing output LF character 2018-10-10 10:45:28 +02:00
shell_help.c shell: allow commands to suspend shell thread 2019-02-14 13:40:28 +01:00
shell_help.h shell: creating new module for help functionality 2018-12-05 15:15:44 +01:00
shell_history.c shell: Allocate proper amount of history slab memory 2019-02-06 07:16:08 -05:00
shell_log_backend.c shell: Add handling of CONFIG_LOG_INPLACE_PROCESS option 2019-02-05 09:55:39 +01:00
shell_ops.c shell: allow commands to suspend shell thread 2019-02-14 13:40:28 +01:00
shell_ops.h shell: allow commands to suspend shell thread 2019-02-14 13:40:28 +01:00
shell_rtt.c shell: Add support to log_panic in RTT backend 2019-02-13 17:25:59 -05:00
shell_uart.c shell: Add handling of CONFIG_LOG_INPLACE_PROCESS option 2019-02-05 09:55:39 +01:00
shell_utils.c shell: changed dead code part in function buffer_trim() 2019-02-26 02:26:52 +01:00
shell_utils.h shell: unify commands execution 2019-02-08 14:58:44 -05:00
shell_vt100.h shell: add meta-keys 2019-01-14 16:01:48 -05:00
shell_wildcard.c shell: allow commands to suspend shell thread 2019-02-14 13:40:28 +01:00
shell_wildcard.h shell: Add wildcard support 2018-09-19 09:30:29 -04:00
shell.c shell: Refactor shell argument count validation 2019-02-20 07:31:35 -05:00