aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2023-01-17 11:22:00 +0100
committerJan200101 <sentrycraft123@gmail.com>2023-01-17 11:22:00 +0100
commitd3fa73ecadfefaee57a196d404a8b687d389027e (patch)
treedd8631893d8fc1cccaa31ea6f9dbb63b12322096
parenta1af9ba65d57be898e079a98229845f42069c1e6 (diff)
downloadOFQT-d3fa73ecadfefaee57a196d404a8b687d389027e.tar.gz
OFQT-d3fa73ecadfefaee57a196d404a8b687d389027e.zip
fix toast usage
the toast API changed when it really shouldn't have.
-rw-r--r--src/toast.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/toast.c b/src/toast.c
index 9d184e5..c7869b4 100644
--- a/src/toast.c
+++ b/src/toast.c
@@ -308,16 +308,23 @@ struct revision_t* getRevisionData(char* url, int rev)
char* buf = malloc(len);
snprintf(buf, len, "%s/%s/%i", url, TOAST_REVISIONS_ENDPOINT, rev);
- struct json_object* revision_list = fetchJSON(buf);
+ struct json_object* revision_data = fetchJSON(buf);
free(buf);
- if (!revision_list)
+ if (!revision_data)
return NULL;
struct revision_t* revision = malloc(sizeof(struct revision_t));
if (!revision)
{
- json_object_put(revision_list);
+ json_object_put(revision_data);
+ return NULL;
+ }
+
+ struct json_object* revision_list = json_object_object_get(revision_data, "changes");
+ if (!revision_list)
+ {
+ json_object_put(revision_data);
return NULL;
}