diff mbox

qemu-kvm: jaso-parser: Output the content of invalid keyword

Message ID 1269424853-15386-1-git-send-email-akong@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Amos Kong March 24, 2010, 10 a.m. UTC
None
diff mbox

Patch

diff --git a/json-parser.c b/json-parser.c
index 579928f..98a82af 100644
--- a/json-parser.c
+++ b/json-parser.c
@@ -12,6 +12,7 @@ 
  */
 
 #include <stdbool.h>
+#include <stdarg.h>
 
 #include "qemu-common.h"
 #include "qstring.h"
@@ -93,7 +94,11 @@  static int token_is_escape(QObject *obj, const char *value)
  */
 static void parse_error(JSONParserContext *ctxt, QObject *token, const char *msg, ...)
 {
-    fprintf(stderr, "parse error: %s\n", msg);
+    va_list ap;
+    va_start(ap, msg);
+    fprintf(stderr, "parse error:");
+    vfprintf(stderr, msg, ap);
+    fprintf(stderr, "\n");
 }
 
 /**