Merge pull request #337 from mnyhlen/bugfix_calculating_nextcheckin

Bugfix: Update variable minutesUntilNextUpdate to 32-bit integer because of integer overflow
This commit is contained in:
Skip Hansen
2024-06-15 09:02:56 -04:00
committed by GitHub

View File

@@ -64,7 +64,7 @@ void contentRunner() {
}
if (taginfo->expectedNextCheckin > now - 10 && taginfo->expectedNextCheckin < now + 30 && taginfo->pendingIdle == 0 && taginfo->pendingCount == 0) {
int16_t minutesUntilNextUpdate = (taginfo->nextupdate - now) / 60;
int32_t minutesUntilNextUpdate = (taginfo->nextupdate - now) / 60;
if (minutesUntilNextUpdate > config.maxsleep) {
minutesUntilNextUpdate = config.maxsleep;
}