From 20693529ef9af82f74822745b8b85f5a534c793b Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 16 Feb 2012 18:20:31 +0100 Subject: [PATCH] core: fix loop limits in echo removal -1 was actually correct, if data->len is 10, i goes from 0 to 8. --- src/mm-at-serial-port.c | 2 +- src/tests/Makefile.am | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c index f49e9f0e..cd4bb133 100644 --- a/src/mm-at-serial-port.c +++ b/src/mm-at-serial-port.c @@ -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 * , assume it's echo or garbage, and skip it */ if (response->data[i] == '\r' && response->data[i + 1] == '\n') { diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 9fcdd9eb..df7157e4 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -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) \