diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 07:59:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 07:59:55 +0000 |
commit | 4db51231d9338c31a1182fcb225e9fd7f57db258 (patch) | |
tree | f83fa4e90727c4891001f956f02cf5a9500f6c05 /util/json.c | |
parent | Releasing debian version 2.3-2. (diff) | |
download | nvme-cli-4db51231d9338c31a1182fcb225e9fd7f57db258.tar.xz nvme-cli-4db51231d9338c31a1182fcb225e9fd7f57db258.zip |
Merging upstream version 2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'util/json.c')
-rw-r--r-- | util/json.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/json.c b/util/json.c index 84d43e5..2de5848 100644 --- a/util/json.c +++ b/util/json.c @@ -35,10 +35,24 @@ struct json_object *util_json_object_new_uint64(uint64_t i) } +static int util_json_object_string_to_number(struct json_object *jso, + struct printbuf *pb, int level, + int flags) +{ + ssize_t len = json_object_get_string_len(jso); + + printbuf_memappend(pb, json_object_get_string(jso), len); + + return 0; +} + struct json_object *util_json_object_new_uint128(nvme_uint128_t val) { struct json_object *obj; + obj = json_object_new_string(uint128_t_to_string(val)); + json_object_set_serializer(obj, util_json_object_string_to_number, NULL, NULL); + return obj; } |