Skip to content
Commit f6f8c3f9 authored by Pisit Sawangvonganan's avatar Pisit Sawangvonganan Committed by Carles Cufí
Browse files

shell: correct z_shell_spaces_trim when len equal to zero



Addresses a potential issue when the string contains only '\0',
which results in z_shell_strlen(str) returning len as 0.
Since the for-loop expects len >= 1, the function now immediately
returns when len == 0.
As the null check for 'str' is already handled inside
z_shell_strlen(), an additional check for 'str' is not needed.

Signed-off-by: default avatarPisit Sawangvonganan <pisit@ndrsolution.com>
parent 5e26cd4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment