1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 15:12:21 +01:00

Fix protobuf encoding size mismatch by passing force parameter in encode_string (#9074)

This commit is contained in:
J. Nick Koston
2025-06-15 16:19:04 -05:00
committed by GitHub
parent fcce4a8be6
commit be58cdda3b
3 changed files with 169 additions and 1 deletions

View File

@@ -216,7 +216,7 @@ class ProtoWriteBuffer {
this->buffer_->insert(this->buffer_->end(), data, data + len);
}
void encode_string(uint32_t field_id, const std::string &value, bool force = false) {
this->encode_string(field_id, value.data(), value.size());
this->encode_string(field_id, value.data(), value.size(), force);
}
void encode_bytes(uint32_t field_id, const uint8_t *data, size_t len, bool force = false) {
this->encode_string(field_id, reinterpret_cast<const char *>(data), len, force);