From 8dde6bb8dd2c063f5740ae78b980343be8e5d669 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 8 Mar 2010 20:01:42 -0800 Subject: [PATCH] core: don't try to remove 0 characters after matching responses --- src/mm-at-serial-port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c index fd4ff6e4..40fbd448 100644 --- a/src/mm-at-serial-port.c +++ b/src/mm-at-serial-port.c @@ -78,7 +78,8 @@ parse_response (MMSerialPort *port, GByteArray *response, GError **error) /* And copy it back into the response array after the parser has removed * matches and cleaned it up. */ - g_byte_array_remove_range (response, 0, response->len); + if (response->len) + g_byte_array_remove_range (response, 0, response->len); g_byte_array_append (response, (const guint8 *) string->str, string->len); g_string_free (string, TRUE); return found;