Bluetooth: Shell: Remove tolower from is_substring

The tolower is not necessary and is what strncasecmp
does anyhow.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2023-12-04 11:22:06 +01:00 committed by Carles Cufí
commit 01bd94ac4f

View file

@ -234,14 +234,12 @@ static bool is_substring(const char *substr, const char *str)
} }
for (size_t pos = 0; pos < str_len; pos++) { for (size_t pos = 0; pos < str_len; pos++) {
if (tolower(substr[pos]) == tolower(str[pos])) { if (pos + sub_str_len > str_len) {
if (pos + sub_str_len > str_len) { return false;
return false; }
}
if (strncasecmp(substr, &str[pos], sub_str_len) == 0) { if (strncasecmp(substr, &str[pos], sub_str_len) == 0) {
return true; return true;
}
} }
} }