summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
7d6a422)
Change-Id: Ie3f38f8c9c0449c3ea28eafec358bdc81ae40b32
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
int j_add_string(struct json_object *obj, const char *key, const char *val)
{
int j_add_string(struct json_object *obj, const char *key, const char *val)
{
- struct json_object *str = json_object_new_string (val);
+ struct json_object *str = json_object_new_string (val ? val : "");
return str ? j_add(obj, key, str) : (errno = ENOMEM, 0);
}
return str ? j_add(obj, key, str) : (errno = ENOMEM, 0);
}