Skip to content

Commit 240388e

Browse files
authored
Do not attempt to read fixed sized result data when indicated length of that data is zero
1 parent 84d44b8 commit 240388e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/WiFiS3/src/Modem.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ ModemClass::ParseResult ModemClass::buf_read(const string &prompt, string &data_
298298

299299
sized_read_size = atoi(data_res.c_str());
300300
data_res.clear();
301+
if (sized_read_size == 0) {
302+
state = at_parse_state_t::Res;
303+
}
301304
} else if(c == '\r') {
302305
state = at_parse_state_t::ResWaitLF;
303306
} else if(c == '\n') {

0 commit comments

Comments
 (0)