Skip to content

Commit f048f7f

Browse files
authored
Improve code readability
1 parent 240388e commit f048f7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/WiFiS3/src/Modem.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -289,16 +289,16 @@ ModemClass::ParseResult ModemClass::buf_read(const string &prompt, string &data_
289289
* in case multiple parameters separated by ',' are sent, they will be present in data_res
290290
* - if we encounter <CR> we need to wait for <LF>
291291
* - if we encounter <LF> we need to parse the response status
292-
* - if we encounter '|', the next token will contain binary sized data, the current value in
292+
* - if we encounter '|', the next token will contain binary sized data, the current value
293293
* in data_res contains the length of the next token
294294
*/
295295

296296
if(c == '|') { // sized read, the previous parameter is the length
297-
state = at_parse_state_t::Sized;
298-
299297
sized_read_size = atoi(data_res.c_str());
300298
data_res.clear();
301-
if (sized_read_size == 0) {
299+
if (sized_read_size != 0) {
300+
state = at_parse_state_t::Sized;
301+
} else {
302302
state = at_parse_state_t::Res;
303303
}
304304
} else if(c == '\r') {

0 commit comments

Comments
 (0)