mirror of
https://github.com/esphome/esphome.git
synced 2025-03-14 06:38:17 +00:00
fix: correct pointer casting for lamp_name_buffer in add_timer method
This commit is contained in:
parent
6022879ee6
commit
7229d44219
@ -232,7 +232,7 @@ bool DynamicLampComponent::add_timer(std::string lamp_name, bool timer_active, u
|
||||
bool friday, bool saturday, bool sunday) {
|
||||
//unsigned char* lamp_name_cstr = lamp_name.c_str();
|
||||
unsigned char lamp_name_buffer[32];
|
||||
strncpy(static_cast<char*>(static_cast<void*>(lamp_name_buffer)), lamp_name.c_str(), 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;
|
||||
new_timer.active = timer_active;
|
||||
|
Loading…
x
Reference in New Issue
Block a user