bluetooth: shell: Fixed logic in is_substring function
Fixed the character check in is_substring function. Signed-off-by: Michele Imbriani - Oticon <mbim@demant.com>
This commit is contained in:
parent
a12dff48ac
commit
b435dc1c6a
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ static bool is_substring(const char *substr, const char *str)
|
|||
}
|
||||
|
||||
for (size_t pos = 0; pos < str_len; pos++) {
|
||||
if (tolower(substr[0]) == tolower(str[pos])) {
|
||||
if (tolower(substr[pos]) == tolower(str[pos])) {
|
||||
if (pos + sub_str_len > str_len) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue