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:
Michele Imbriani - Oticon 2023-10-05 14:20:01 +02:00 committed by Carles Cufí
commit b435dc1c6a

View file

@ -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;
}