diff --git a/components/esp_modem/src/esp_modem_command_library.cpp b/components/esp_modem/src/esp_modem_command_library.cpp index a4743c13a..77957afb2 100644 --- a/components/esp_modem/src/esp_modem_command_library.cpp +++ b/components/esp_modem/src/esp_modem_command_library.cpp @@ -167,7 +167,7 @@ command_result get_battery_status(CommandableIf *t, int &voltage, int &bcs, int // Parsing +CBC: ,, out = out.substr(pattern.size()); int pos, value, property = 0; - while ((pos = out.find(',') != std::string::npos)) { + while ((pos = out.find(',')) != std::string::npos) { if (std::from_chars(out.data(), out.data() + pos, value).ec == std::errc::invalid_argument) { return command_result::FAIL; }