mirror of
https://github.com/wled/WLED.git
synced 2025-07-15 06:46:34 +00:00
oappend robustness improvement
obuf is reset to nullptr in some cases
This commit is contained in:
parent
d6735bed4f
commit
082d1eea48
@ -148,7 +148,7 @@ bool oappendi(int i)
|
|||||||
bool oappend(const char* txt)
|
bool oappend(const char* txt)
|
||||||
{
|
{
|
||||||
uint16_t len = strlen(txt);
|
uint16_t len = strlen(txt);
|
||||||
if (olen + len >= SETTINGS_STACK_BUF_SIZE) {
|
if ((obuf == nullptr) || (olen + len >= SETTINGS_STACK_BUF_SIZE)) { // sanity checks
|
||||||
#ifdef WLED_DEBUG
|
#ifdef WLED_DEBUG
|
||||||
DEBUG_PRINT(F("oappend() buffer overflow. Cannot append "));
|
DEBUG_PRINT(F("oappend() buffer overflow. Cannot append "));
|
||||||
DEBUG_PRINT(len); DEBUG_PRINT(F(" bytes \t\""));
|
DEBUG_PRINT(len); DEBUG_PRINT(F(" bytes \t\""));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user