Received: from eggs.gnu.org ([2001:4830:134:3::10]:37715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avzy1-00077K-Kl for qemu-devel@nongnu.org; Fri, 29 Apr 2016 00:23:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avzy0-0000rs-T6 for qemu-devel@nongnu.org; Fri, 29 Apr 2016 00:23:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avzy0-0000rn-OO for qemu-devel@nongnu.org; Fri, 29 Apr 2016 00:23:48 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 713297F084 for ; Fri, 29 Apr 2016 04:23:48 +0000 (UTC) From: Eric Blake Date: Thu, 28 Apr 2016 22:23:26 -0600 Message-Id: <1461903820-3092-6-git-send-email-eblake@redhat.com> In-Reply-To: <1461903820-3092-1-git-send-email-eblake@redhat.com> References: <1461903820-3092-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v3 05/18] 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: armbru@redhat.com, famz@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 Reviewed-by: Fam Zheng --- v3: no change v2: no change --- 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 c18e48a..5fbaf58 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.5.5