From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBArI-0000Q2-UD for qemu-devel@nongnu.org; Mon, 21 Dec 2015 19:31:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBArI-00024K-0g for qemu-devel@nongnu.org; Mon, 21 Dec 2015 19:31:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBArH-00024C-Sf for qemu-devel@nongnu.org; Mon, 21 Dec 2015 19:31:19 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 8B1BE693C5 for ; Tue, 22 Dec 2015 00:31:19 +0000 (UTC) From: Eric Blake Date: Mon, 21 Dec 2015 17:30:59 -0700 Message-Id: <1450744268-25052-6-git-send-email-eblake@redhat.com> In-Reply-To: <1450744268-25052-1-git-send-email-eblake@redhat.com> References: <1450744268-25052-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v2 05/14] qapi: Use qstring_append_chr() where appropriate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, armbru@redhat.com, Luiz Capitulino No need to create a temporary buffer, when we already have a function available for our needs. Signed-off-by: Eric Blake --- qobject/json-parser.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 441c6e9..fc5510e 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -204,12 +204,7 @@ static QString *qstring_from_escaped_str(JSONParserContext *ctxt, goto out; } } else { - char dummy[2]; - - dummy[0] = *ptr++; - dummy[1] = 0; - - qstring_append(str, dummy); + qstring_append_chr(str, *ptr++); } } -- 2.4.3