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:
Aleksander Morgado
2012-02-16 18:20:31 +01:00
parent 21162a366a
commit 20693529ef
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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') {
+2 -1
View File
@@ -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) \