diff options
author | Dan Williams <dcbw@redhat.com> | 2010-03-08 20:01:42 -0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-03-08 20:01:42 -0800 |
commit | 8dde6bb8dd2c063f5740ae78b980343be8e5d669 (patch) | |
tree | 286f6bf5707eff4b310d8a840f2d0783dafe6349 /src | |
parent | f3721a5674ef7899d9a6ef0f4c5b356720bb9833 (diff) |
core: don't try to remove 0 characters after matching responses
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-at-serial-port.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |