X-Git-Url: https://git.wpitchoune.net/gitweb/?p=prss.git;a=blobdiff_plain;f=src%2Fttrss.c;h=00ee138bc84ae52084b95c1c9518ab2e500b4b6d;hp=f955cee22c2244c3158a10bf0a37f6903cb72f56;hb=f44145caeb28320e1eb239fa04ff5da5ee89cafd;hpb=5a09ab51871a302a2d68533d7e086dfe86d9eb11 diff --git a/src/ttrss.c b/src/ttrss.c index f955cee..00ee138 100644 --- a/src/ttrss.c +++ b/src/ttrss.c @@ -37,9 +37,9 @@ static int list_length(void **list) if (!list) return 0; - + n = 0; - while(*list) { + while (*list) { n++; list++; } @@ -241,22 +241,21 @@ char *ws_get_article_content(int id) rq = ws_request_new("getArticle"); ws_request_add_att_int(rq, "article_id", id); - + rp = ws_execute(rq); - + json_object_put(rq); str = NULL; if (rp) { item = json_object_array_get_idx(rp, 0); - + if (item) { content = json_object_object_get(item, "content"); - str = strdup(json_object_get_string(content)); } - + json_object_put(rp); } @@ -284,7 +283,7 @@ int ws_update_headlines(struct feed *feed) j = json_object_object_get(jheadline, "id"); hid = json_object_get_int(j); h = feed_get_headline(feed, hid); - + if (!h) { h = malloc(sizeof(struct headline)); h->id = hid; @@ -292,7 +291,7 @@ int ws_update_headlines(struct feed *feed) h->content = NULL; h->title = NULL; h->url = NULL; - + tmp = headlines_add(feed->headlines, h); if (feed->headlines) free(feed->headlines); @@ -403,7 +402,7 @@ void ttrss_set_article_unread(int id, int unread) json_object_object_add(rq, "mode", json_object_new_int(unread)); rp = http_json_get(session_url, rq); - + json_object_put(rq); json_object_put(rp); }