[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/11] qapi: Use qstring_append_chr() where appropri
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH 05/11] qapi: Use qstring_append_chr() where appropriate |
Date: |
Thu, 10 Dec 2015 16:53:35 -0700 |
No need to create a temporary buffer, when we already have a
function available for our needs.
Signed-off-by: Eric Blake <address@hidden>
---
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
- [Qemu-devel] [RFC PATCH 00/11] Add qapi-to-JSON output visitor, Eric Blake, 2015/12/10
- [Qemu-devel] [PATCH 09/11] qapi: Add qobject_to_json_pretty_prefix(), Eric Blake, 2015/12/10
- [Qemu-devel] [PATCH 10/11] qapi: Support pretty printing in JSON output visitor, Eric Blake, 2015/12/10
- [Qemu-devel] [PATCH 01/11] qapi: Rename qjson.h to qobject-json.h, Eric Blake, 2015/12/10
- [Qemu-devel] [PATCH 06/11] qapi: Add qstring_append_format(), Eric Blake, 2015/12/10