diff --git a/esphome/components/remote_base/aeha_protocol.cpp b/esphome/components/remote_base/aeha_protocol.cpp index 6cb08cdfddd..3b926e79815 100644 --- a/esphome/components/remote_base/aeha_protocol.cpp +++ b/esphome/components/remote_base/aeha_protocol.cpp @@ -85,7 +85,7 @@ optional AEHAProtocol::decode(RemoteReceiveData src) { std::string AEHAProtocol::format_data_(const std::vector &data) { std::string out; for (uint8_t byte : data) { - char buf[8]; // "0x%02X," = 6 chars + null + margin + char buf[8]; // "0x%02X," = 5 chars + null + margin snprintf(buf, sizeof(buf), "0x%02X,", byte); out += buf; }