projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zbd: remove zbd_zoned_model ZBD_IGNORE
[fio.git]
/
json.h
diff --git
a/json.h
b/json.h
index b2bb457ea95c0b49f791a4bf6b220a0de7df85f7..d98242638d4a186b13fa6ba2da86639454dc47b8 100644
(file)
--- a/
json.h
+++ b/
json.h
@@
-82,7
+82,7
@@
static inline int json_object_add_value_string(struct json_object *obj,
.type = JSON_TYPE_STRING,
};
.type = JSON_TYPE_STRING,
};
- arg.string =
(char *)val
;
+ arg.string =
strdup(val ? : "")
;
return json_object_add_value_type(obj, name, &arg);
}
return json_object_add_value_type(obj, name, &arg);
}
@@
-92,9
+92,9
@@
static inline int json_object_add_value_object(struct json_object *obj,
{
struct json_value arg = {
.type = JSON_TYPE_OBJECT,
{
struct json_value arg = {
.type = JSON_TYPE_OBJECT,
- .object = val,
};
};
+ arg.object = val;
return json_object_add_value_type(obj, name, &arg);
}
return json_object_add_value_type(obj, name, &arg);
}