From 7a80925eabe969ffc1e8e24c2ad31c80c33ab3cd Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 13 Feb 2014 08:48:37 +0000 Subject: Update json-parser code to git rev 11a80f389769d1f66ca7fbe64ad89c82d3ba4ba9. Few BitlBee-specific diffs now. Annoyingly need to link to libm now for the use of the function pow() since the lib now does its own number parsing... --- protocols/twitter/twitter_lib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protocols/twitter/twitter_lib.c') diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index a98054dd..1ab464ef 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -163,7 +163,7 @@ char *twitter_parse_error(struct http_request *req) ret = NULL; if (req->body_size > 0) { - root = json_parse(req->reply_body); + root = json_parse(req->reply_body, req->body_size); err = json_o_get(root, "errors"); if (err && err->type == json_array && (err = err->u.array.values[0]) && err->type == json_object) { @@ -219,7 +219,7 @@ static json_value *twitter_parse_response(struct im_connection *ic, struct http_ td->http_fails = 0; } - if ((ret = json_parse(req->reply_body)) == NULL) { + if ((ret = json_parse(req->reply_body, req->body_size)) == NULL) { imcb_error(ic, "Could not retrieve %s: %s", path, "XML parse error"); } @@ -262,7 +262,7 @@ static gboolean twitter_xt_get_friends_id_list(json_value *node, struct twitter_ continue; txl->list = g_slist_prepend(txl->list, - g_strdup_printf("%lld", c->u.array.values[i]->u.integer)); + g_strdup_printf("%" PRIu64, c->u.array.values[i]->u.integer)); } c = json_o_get(node, "next_cursor"); @@ -772,7 +772,7 @@ static void twitter_http_stream(struct http_request *req) c = req->reply_body[len]; req->reply_body[len] = '\0'; - if ((parsed = json_parse(req->reply_body))) { + if ((parsed = json_parse(req->reply_body, req->body_size))) { twitter_stream_handle_object(ic, parsed); } json_value_free(parsed); -- cgit v1.2.3