1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

fix: update memcpy call in add_timer method to include size for lamp_name

This commit is contained in:
Oliver Kleinecke 2025-02-18 14:53:33 +01:00
parent 04ae8a692f
commit 6770099099

View File

@ -234,7 +234,7 @@ bool DynamicLampComponent::add_timer(std::string lamp_name, bool timer_active, u
unsigned char lamp_name_buffer[32];
strncpy(static_cast<char*>(static_cast<void*>(&lamp_name_buffer)), lamp_name.c_str(), 32);
DynamicLampTimer new_timer;
memcpy(new_timer.lamp_name, lamp_name_buffer);
memcpy(new_timer.lamp_name, lamp_name_buffer, 32);
new_timer.active = timer_active;
new_timer.mode = mode;
new_timer.hour = hour;