Skip to content

Commit 3d9f811

Browse files
committed
Few ESP specific fixes
1 parent 50c0aca commit 3d9f811

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/rules/rules.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ static int16_t lexer_peek(char **text, uint16_t skip, uint8_t *type, uint16_t *s
421421
uint8_t loop = 1;
422422

423423
while(loop) {
424+
#ifdef ESP8266
425+
ESP.wdtFeed();;
426+
#endif
424427
*type = getval((*text)[i]);
425428
*start = i;
426429
*len = 0;
@@ -5321,8 +5324,8 @@ int8_t rule_initialize(struct pbuf *input, struct rules_t ***rules, uint8_t *nrr
53215324
/*LCOV_EXCL_STOP*/
53225325

53235326
if(rule_prepare((char **)&input->payload, &bcsize, &heapsize, &varsize, &memsize, &newlen) == -1 ||
5324-
(varsize/sizeof(struct vm_vchar_t)/2) > INT8_MAX) {
5325-
if(varsize/sizeof(struct vm_vchar_t)/2 > INT8_MAX) {
5327+
(varsize/sizeof(struct vm_vchar_t)) > INT8_MAX) {
5328+
if(varsize/sizeof(struct vm_vchar_t) > INT8_MAX) {
53265329
logprintf_P(F("ERROR: maximum number of 127 variables reached"));
53275330
}
53285331
if((*rules = (struct rules_t **)REALLOC(*rules, sizeof(struct rules_t **)*((*nrrules)))) == NULL) {

0 commit comments

Comments
 (0)