is_error.patch 626 B

123456789101112131415161718192021222324252627
  1. --- a/src/rsensor.c 2016-12-20 00:39:54.000000000 +0100
  2. +++ b/src/rsensor.c 2018-01-05 19:30:09.089759050 +0100
  3. @@ -133,7 +133,7 @@
  4. obj = get_json_object(url);
  5. - if (obj && !is_error(obj)) {
  6. + if (obj && (obj != NULL)) {
  7. n = json_object_array_length(obj);
  8. sensors = malloc((n + 1) * sizeof(struct psensor *));
  9. @@ -168,12 +168,12 @@
  10. obj = get_json_object(get_url(s));
  11. - if (obj && !is_error(obj)) {
  12. + if (obj && (obj != NULL)) {
  13. json_object *om;
  14. json_object_object_get_ex(obj, "last_measure", &om);
  15. - if (!is_error(obj)) {
  16. + if (obj != NULL) {
  17. json_object *ov, *ot;
  18. struct timeval tv;