From: Jens Axboe Date: Wed, 24 May 2017 01:59:28 +0000 (-0600) Subject: Revert "Fixed json_print_value so that ending double quote of JSON string value will... X-Git-Tag: fio-2.21~43 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=2374148c29a4ff6aa8c95a517447fbf9035b9f44;hp=af13d1e88158d3e37940648be139d7a46fe00431 Revert "Fixed json_print_value so that ending double quote of JSON string value will not disappear" This reverts commit 002e57665ed7eebe920de6f1729ef2e403b7c6cc. This commit breaks client/server with json output, since buf == NULL for that case. --- diff --git a/json.c b/json.c index 2160d296..e0227ec6 100644 --- a/json.c +++ b/json.c @@ -340,13 +340,9 @@ 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) { - 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_STRING: + log_buf(out, "\"%s\"", value->string); + break; case JSON_TYPE_INTEGER: log_buf(out, "%lld", value->integer_number); break;