mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Move from stack allocated to heap
This commit is contained in:
parent
749099a6c7
commit
ec52c1a10a
@ -531,9 +531,8 @@ bool RulesRuleMatch(uint8_t rule_set, String &event, String &rule)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
char buf[event.length()+1];
|
String buf = event; // copy the string into a new buffer that will be modified
|
||||||
strcpy(buf, event.c_str());
|
JsonParser parser = JsonParser((char*)buf.c_str());
|
||||||
JsonParser parser = JsonParser(buf);
|
|
||||||
JsonParserObject obj = parser.getRootObject();
|
JsonParserObject obj = parser.getRootObject();
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("RUL: Event too long (%d)"), event.length());
|
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("RUL: Event too long (%d)"), event.length());
|
||||||
@ -1074,8 +1073,6 @@ bool RulesMqttData(void)
|
|||||||
} else { //If specified Key, need to parse Key/Value from JSON data
|
} else { //If specified Key, need to parse Key/Value from JSON data
|
||||||
JsonParserObject jsonData = JsonParser((char*)sData.c_str()).getRootObject();
|
JsonParserObject jsonData = JsonParser((char*)sData.c_str()).getRootObject();
|
||||||
|
|
||||||
// StaticJsonBuffer<500> jsonBuf;
|
|
||||||
// JsonObject& jsonData = jsonBuf.parseObject(sData);
|
|
||||||
String key1 = event_item.Key;
|
String key1 = event_item.Key;
|
||||||
String key2;
|
String key2;
|
||||||
if (!jsonData) break; //Failed to parse JSON data, ignore this message.
|
if (!jsonData) break; //Failed to parse JSON data, ignore this message.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user