libxl: libxl_qmp: Better error message after a parse error.
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 4 Nov 2011 12:38:22 +0000 (12:38 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Fri, 4 Nov 2011 12:38:22 +0000 (12:38 +0000)
By setting the next string to parse after having printed any error messages.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
tools/libxl/libxl_qmp.c

index ef36348d29b9d057d7a75f58f1cdecf48d756db1..f61a87a89f54ace281731b247d014486079ff526 100644 (file)
@@ -403,7 +403,6 @@ static int qmp_next(libxl__gc *gc, libxl__qmp_handler *qmp)
                 *end = '\0';
 
                 o = libxl__json_parse(gc, s);
-                s = end + 2;
 
                 if (o) {
                     qmp_handle_response(qmp, o);
@@ -413,6 +412,8 @@ static int qmp_next(libxl__gc *gc, libxl__qmp_handler *qmp)
                                "Parse error of : %s\n", s);
                     return -1;
                 }
+
+                s = end + 2;
             } else {
                 break;
             }