diff options
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; |