projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c78997b
)
Fixed json_print_value so that ending double quote of JSON string value will not...
author
YukiKita
<kita.yuki@gmail.com>
Wed, 17 May 2017 00:05:29 +0000
(09:05 +0900)
committer
YukiKita
<kita.yuki@gmail.com>
Wed, 17 May 2017 00:05:29 +0000
(09:05 +0900)
json.c
patch
|
blob
|
blame
|
history
diff --git
a/json.c
b/json.c
index e0227ec6446bdfafe678dee39583109fe461fe7d..2160d296445fae5cf5aebbd8fbdb91155bf71cfc 100644
(file)
--- a/
json.c
+++ b/
json.c
@@
-340,9
+340,13
@@
static void json_print_array(struct json_array *array, struct buf_output *out)
static void json_print_value(struct json_value *value, struct buf_output *out)
{
switch (value->type) {
static void json_print_value(struct json_value *value, struct buf_output *out)
{
switch (value->type) {
- case JSON_TYPE_STRING:
- log_buf(out, "\"%s\"", value->string);
- break;
+ case JSON_TYPE_STRING: {
+ const char delimiter = '"';
+ buf_output_add(out, &delimiter, sizeof(delimiter));
+ buf_output_add(out, value->string, strlen(value->string));
+ buf_output_add(out, &delimiter, sizeof(delimiter));
+ break;
+ }
case JSON_TYPE_INTEGER:
log_buf(out, "%lld", value->integer_number);
break;
case JSON_TYPE_INTEGER:
log_buf(out, "%lld", value->integer_number);
break;