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

fix: replace pointer assignment with memcpy for lamp_name in add_timer method

This commit is contained in:
Oliver Kleinecke 2025-02-18 14:50:38 +01:00
parent 7229d44219
commit 04ae8a692f

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;
new_timer.lamp_name = lamp_name_buffer;
memcpy(new_timer.lamp_name, lamp_name_buffer);
new_timer.active = timer_active;
new_timer.mode = mode;
new_timer.hour = hour;