@@ -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