Imported Debian patch 0.8.0.4-1.1
[psensor-pkg-debian.git] / debian / patches / json-c-FTBFS-fix.patch
diff --git a/debian/patches/json-c-FTBFS-fix.patch b/debian/patches/json-c-FTBFS-fix.patch
new file mode 100644 (file)
index 0000000..d5f82cd
--- /dev/null
@@ -0,0 +1,26 @@
+Description: Update json usage for current API
+ The json-c interface was using a deprecated method.
+ This cherry-picked patch from upstream fixes it.
+ .
+ psensor (0.8.0.4-1.1) unstable; urgency=low
+ .
+Author: Wookey <wookey@debian.org>
+Bug-Debian: http://bugs.debian.org/746145
+Origin: upstream, http://wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff;h=695aaee544240f86415140a77f5716f858bec91e
+Last-Update: 2014-05-31
+
+--- psensor-0.8.0.4.orig/src/lib/psensor_json.c
++++ psensor-0.8.0.4/src/lib/psensor_json.c
+@@ -140,9 +140,9 @@ struct psensor *psensor_new_from_json(js
+       struct psensor *s;
+       char *eid, *url;
+-      oid = json_object_object_get(o, "id");
+-      oname = json_object_object_get(o, "name");
+-      otype = json_object_object_get(o, "type");
++      json_object_object_get_ex(o, "id", &oid);
++      json_object_object_get_ex(o, "name", &oname);
++      json_object_object_get_ex(o, "type", &otype);
+       eid = url_encode(json_object_get_string(oid));
+       url = malloc(strlen(sensors_url) + 1 + strlen(eid) + 1);