aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/twitter/twitter_lib.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-04-18 16:14:08 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2011-04-18 16:14:08 +0200
commit6eca2eb9a06d0991fa0f431839e528177313566a (patch)
tree44960d1c0f417cd9c989428317b937d89f6686b7 /protocols/twitter/twitter_lib.c
parent6cc36efa70ff179de1468c8cfe614152366fa27b (diff)
Try to show better Twitter error messages. Sadly this doesn't always work
since Twitter can't seem to make up their mind on the formatting of their error responses, sometimes using XML and sometimes plain text.
Diffstat (limited to 'protocols/twitter/twitter_lib.c')
-rw-r--r--protocols/twitter/twitter_lib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c
index e8fb3530..472ce944 100644
--- a/protocols/twitter/twitter_lib.c
+++ b/protocols/twitter/twitter_lib.c
@@ -141,7 +141,7 @@ static void twitter_add_buddy(struct im_connection *ic, char *name, const char *
/* Warning: May return a malloc()ed value, which will be free()d on the next
call. Only for short-term use. */
-static char *twitter_parse_error(struct http_request *req)
+char *twitter_parse_error(struct http_request *req)
{
static char *ret = NULL;
struct xt_parser *xp = NULL;
@@ -160,14 +160,12 @@ static char *twitter_parse_error(struct http_request *req)
node->text_len > 0)
{
ret = g_strdup_printf("%s (%s)", req->status_string, node->text);
- xt_free(xp);
- return ret;
}
xt_free(xp);
}
- return req->status_string;
+ return ret ? ret : req->status_string;
}
static void twitter_http_get_friends_ids(struct http_request *req);