mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Replace strlcpy with strncpy
This commit is contained in:
parent
0dc6e58b86
commit
9a17e70daf
@ -180,8 +180,7 @@ void Page::set_name(uint8_t pageid, const char* name)
|
|||||||
_pagenames[pageid] = (char*)hasp_calloc(sizeof(char), size);
|
_pagenames[pageid] = (char*)hasp_calloc(sizeof(char), size);
|
||||||
LOG_VERBOSE(TAG_HASP, F("%s - %d"), __FILE__, __LINE__);
|
LOG_VERBOSE(TAG_HASP, F("%s - %d"), __FILE__, __LINE__);
|
||||||
if(_pagenames[pageid] == NULL) return;
|
if(_pagenames[pageid] == NULL) return;
|
||||||
memset(_pagenames[pageid], 0, size);
|
strncpy(_pagenames[pageid], name, size);
|
||||||
strlcpy(_pagenames[pageid], name, size);
|
|
||||||
LOG_VERBOSE(TAG_HASP, F("%s"), _pagenames[pageid]);
|
LOG_VERBOSE(TAG_HASP, F("%s"), _pagenames[pageid]);
|
||||||
}
|
}
|
||||||
LOG_VERBOSE(TAG_HASP, F("%s - %d"), __FILE__, __LINE__);
|
LOG_VERBOSE(TAG_HASP, F("%s - %d"), __FILE__, __LINE__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user