mirror of
https://github.com/esphome/esphome.git
synced 2026-02-20 08:25:35 -07:00
bot review
This commit is contained in:
@@ -87,7 +87,8 @@ class StringRef {
|
||||
if (pos >= len_)
|
||||
return std::string::npos;
|
||||
const char *result = std::strstr(base_ + pos, s);
|
||||
return result ? static_cast<size_type>(result - base_) : std::string::npos;
|
||||
// Verify match is within bounds (strstr searches to null terminator)
|
||||
return (result && result < base_ + len_) ? static_cast<size_type>(result - base_) : std::string::npos;
|
||||
}
|
||||
size_type find(char c, size_type pos = 0) const {
|
||||
if (pos >= len_)
|
||||
|
||||
Reference in New Issue
Block a user