core: don't try to remove 0 characters after matching responses

This commit is contained in:
Dan Williams
2010-03-08 20:01:42 -08:00
parent f3721a5674
commit 8dde6bb8dd
+2 -1
View File
@@ -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;