core: fix loop limits in echo removal
-1 was actually correct, if data->len is 10, i goes from 0 to 8.
This commit is contained in:
@@ -66,7 +66,7 @@ mm_at_serial_port_remove_echo (GByteArray *response)
|
||||
if (response->len <= 2)
|
||||
return;
|
||||
|
||||
for (i = 0; i < (response->len - 2); i++) {
|
||||
for (i = 0; i < (response->len - 1); i++) {
|
||||
/* If there is any content before the first
|
||||
* <CR><LF>, assume it's echo or garbage, and skip it */
|
||||
if (response->data[i] == '\r' && response->data[i + 1] == '\n') {
|
||||
|
||||
@@ -53,7 +53,8 @@ test_at_serial_port_SOURCES = \
|
||||
|
||||
test_at_serial_port_CPPFLAGS = \
|
||||
$(MM_CFLAGS) \
|
||||
-I$(top_srcdir)
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/src
|
||||
|
||||
test_at_serial_port_LDADD = \
|
||||
$(MM_LIBS) \
|
||||
|
||||
Reference in New Issue
Block a user