Skip to content

Commit d131122

Browse files
committed
Compiler warning fix
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
1 parent f6a5364 commit d131122

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/TinyGsmClientSIM7080.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,12 @@ class TinyGsmSim7080
676676
char buf[12];
677677
size_t bytesRead = stream.readBytesUntil('\n', buf,
678678
static_cast<size_t>(12));
679-
679+
// if we read 12 or more bytes, it's an overflow
680+
if (bytesRead && bytesRead < 12) {
681+
buf[bytesRead] = '\0';
682+
modem_time = atol(buf);
683+
}
684+
waitResponse();
680685
DBG(GF("### Modem Raw Time:"), buf, GF("("), modem_time, GF(")"));
681686

682687
if (modem_time != 0) {

0 commit comments

Comments
 (0)