diff --git a/src/serial.cpp b/src/serial.cpp index 37b5d704..a9e6f84b 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -188,6 +188,7 @@ Serial::readline (string &buffer, size_t size, string eol) if (bytes_read == 0) { break; // Timeout occured on reading 1 byte } + if(read_so_far < eol_len) continue; if (string (reinterpret_cast (buffer_ + read_so_far - eol_len), eol_len) == eol) { break; // EOL found @@ -229,6 +230,7 @@ Serial::readlines (size_t size, string eol) } break; // Timeout occured on reading 1 byte } + if(read_so_far < eol_len) continue; if (string (reinterpret_cast (buffer_ + read_so_far - eol_len), eol_len) == eol) { // EOL found