From e7715af875eb26517ae63e6e1db784b903da702e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 17 Jul 2012 15:49:05 -0500 Subject: [PATCH] serial: fix AT port carriage return handling Off-by-one, fix it. --- src/mm-at-serial-port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c index c16e8786..38ec38e4 100644 --- a/src/mm-at-serial-port.c +++ b/src/mm-at-serial-port.c @@ -297,7 +297,7 @@ at_command_to_byte_array (const char *command) g_byte_array_append (buf, (const guint8 *) command, cmdlen); /* Make sure there's a trailing carriage return */ - if (command[cmdlen] != '\r') + if (command[cmdlen - 1] != '\r') g_byte_array_append (buf, (const guint8 *) "\r", 1); return buf;