X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor-pkg-ubuntu.git;a=blobdiff_plain;f=src%2Frsensor.c;h=8a5aa66182d91dc79358352625b9df619486b6b4;hp=32c182c25165b75fd6cda34da120e7be4cde0c2e;hb=4c50d430bea4b8462b0ae7ab70baf3f538f87718;hpb=0470c31b8a4293914a6fd9b089503775706da084 diff --git a/src/rsensor.c b/src/rsensor.c index 32c182c..8a5aa66 100644 --- a/src/rsensor.c +++ b/src/rsensor.c @@ -163,14 +163,14 @@ void remote_psensor_update(struct psensor *s) if (obj && !is_error(obj)) { json_object *om; - om = json_object_object_get(obj, "last_measure"); + json_object_object_get_ex(obj, "last_measure", &om); if (!is_error(obj)) { json_object *ov, *ot; struct timeval tv; - ov = json_object_object_get(om, "value"); - ot = json_object_object_get(om, "time"); + json_object_object_get_ex(om, "value", &ov); + json_object_object_get_ex(om, "time", &ot); tv.tv_sec = json_object_get_int(ot); tv.tv_usec = 0;