if (!jstring)
return false;
+ /* Overwrite old value if present */
+ json_object_object_del(jobj, desc);
+
json_object_object_add(jobj, desc, jstring);
return true;
}
strftime(buf, 80, "%FT%TZ", tp);
- json_object_object_del(jobj, "timestamp");
-
return add_string(jobj, "timestamp", buf);
}
{
json_object *jval;
- json_object_object_del(jobj, keyword);
-
jval = json_object_new_int(val);
if (!jval)
return false;
+ /* Overwrite old value if present */
+ json_object_object_del(jobj, keyword);
+
json_object_object_add(jobj, keyword, jval);
return true;
}
{
json_object *jval;
- json_object_object_del(jobj, keyword);
-
jval = json_object_new_boolean(val);
if (!jval)
return false;
+ /* Overwrite old value if present */
+ json_object_object_del(jobj, keyword);
+
json_object_object_add(jobj, keyword, jval);
return true;
}
if (!jstring)
return false;
+ /* Overwrite old value if present */
+ json_object_object_del(jobj, desc);
+
json_object_object_add(jobj, desc, jstring);
return true;
}
if (!jstring)
return false;
+ /* Overwrite old value if present */
+ json_object_object_del(jobj, desc);
+
json_object_object_add(jobj, desc, jstring);
return true;
}
if (!jstring)
return false;
+ /* Overwrite old value if present */
+ json_object_object_del(jobj, desc);
+
json_object_object_add(jobj, desc, jstring);
return true;
}