From d3fa73ecadfefaee57a196d404a8b687d389027e Mon Sep 17 00:00:00 2001 From: Jan200101 Date: Tue, 17 Jan 2023 11:22:00 +0100 Subject: fix toast usage the toast API changed when it really shouldn't have. --- src/toast.c | 13 ++++++++++--- 1 file 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; } -- cgit v1.2.3