projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
t/fiotestlib: pass command-line options to FioJobFileTest
[fio.git]
/
json.h
diff --git
a/json.h
b/json.h
index d98242638d4a186b13fa6ba2da86639454dc47b8..66bb06b1f17024b6759b585dfc5d9b9afcfa0326 100644
(file)
--- a/
json.h
+++ b/
json.h
@@
-81,8
+81,13
@@
static inline int json_object_add_value_string(struct json_object *obj,
struct json_value arg = {
.type = JSON_TYPE_STRING,
};
+ union {
+ const char *a;
+ char *b;
+ } string;
- arg.string = strdup(val ? : "");
+ string.a = val ? val : "";
+ arg.string = string.b;
return json_object_add_value_type(obj, name, &arg);
}