Skip to content

Commit adc4111

Browse files
committed
Fix sleep time overflow
1 parent ab36f4d commit adc4111

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TheThingsNetwork.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ bool TheThingsNetwork::sendPayload(uint8_t mode, uint8_t port, uint8_t *payload,
945945

946946
void TheThingsNetwork::sleep(uint32_t mseconds)
947947
{
948-
if (mseconds < 100 || mseconds >= 4294967296)
948+
if (mseconds < 100)
949949
{
950950
return;
951951
}
@@ -954,7 +954,7 @@ void TheThingsNetwork::sleep(uint32_t mseconds)
954954
sendCommand(SYS_TABLE, SYS_PREFIX, true);
955955
sendCommand(SYS_TABLE, SYS_SLEEP, true);
956956

957-
sprintf(buffer, "%ld", mseconds);
957+
sprintf(buffer, "%lu", mseconds);
958958
modemStream->write(buffer);
959959
modemStream->write(SEND_MSG);
960960
debugPrintLn(buffer);

0 commit comments

Comments
 (0)