From patchwork Wed Mar 24 10:00:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 87851 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2OA0p60016478 for ; Wed, 24 Mar 2010 10:00:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755290Ab0CXKAt (ORCPT ); Wed, 24 Mar 2010 06:00:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34216 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755181Ab0CXKAs (ORCPT ); Wed, 24 Mar 2010 06:00:48 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2OA0bOC023724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Mar 2010 06:00:37 -0400 Received: from localhost.localdomain ([10.66.91.190]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2OA0Y1T001656; Wed, 24 Mar 2010 06:00:35 -0400 From: Amos Kong To: aurelien@aurel32.net Cc: kvm@vger.kernel.org, Amos Kong Subject: [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword Date: Wed, 24 Mar 2010 18:00:53 +0800 Message-Id: <1269424853-15386-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 24 Mar 2010 10:00:51 +0000 (UTC) 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 +#include #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"); } /**