X-Git-Url: http://wpitchoune.net/gitweb/?p=psensor-pkg-debian.git;a=blobdiff_plain;f=src%2Frsensor.c;h=8a5aa66182d91dc79358352625b9df619486b6b4;hp=9bebb7a676c23be1f44d225c07ac4a1ddc4b423f;hb=620c63bda7a47ddf6cd126ee12c03628894dd18c;hpb=1438bc505641cd98fe3af323fb2329c3284e157f diff --git a/src/rsensor.c b/src/rsensor.c index 9bebb7a..8a5aa66 100644 --- a/src/rsensor.c +++ b/src/rsensor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 jeanfi@gmail.com + * Copyright (C) 2010-2014 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -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;