diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-07 00:54:00 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-04-07 00:54:00 +0100 |
commit | 0519b0a42b5e0ed09f796a92aa7bd3b7d3f06b9d (patch) | |
tree | 60f9441c100f536548a9b225d54f87e3efb24f2d | |
parent | 2abceca711403e8e3308213954b4477ceecd4282 (diff) |
Killed unused twitter_urldecode() and silence some compiler warnings.
-rw-r--r-- | protocols/twitter/twitter_http.c | 43 | ||||
-rw-r--r-- | protocols/twitter/twitter_lib.c | 2 |
2 files changed, 2 insertions, 43 deletions
diff --git a/protocols/twitter/twitter_http.c b/protocols/twitter/twitter_http.c index 34b9408d..3632140f 100644 --- a/protocols/twitter/twitter_http.c +++ b/protocols/twitter/twitter_http.c @@ -120,7 +120,7 @@ void *twitter_http(char *url_string, http_input_function func, gpointer data, in if (is_post) { // Append the Content-Type and url-encoded arguments. - tmp = g_strdup_printf("%sContent-Type: application/x-www-form-urlencoded\r\nContent-Length: %i\r\n\r\n%s", + tmp = g_strdup_printf("%sContent-Type: application/x-www-form-urlencoded\r\nContent-Length: %zd\r\n\r\n%s", request, strlen(url_arguments), url_arguments); g_free(request); request = tmp; @@ -159,44 +159,3 @@ char *twitter_url_append(char *url, char *key, char* value) return retval; } - -char *twitter_urldecode(const char *instr) -{ - int ipos=0, bpos=0; - char *str = NULL; - char entity[3]={0,0,0}; - unsigned dec; - int len = strlen(instr); - - if(!(str = g_new(char, len+1) )) - return ""; - - while(instr[ipos]) { - while(instr[ipos] && instr[ipos]!='%') - if(instr[ipos]=='+') { - str[bpos++]=' '; - ipos++; - } else - str[bpos++] = instr[ipos++]; - if(!instr[ipos]) - break; - - if(instr[ipos+1] && instr[ipos+2]) { - ipos++; - entity[0]=instr[ipos++]; - entity[1]=instr[ipos++]; - sscanf(entity, "%2x", &dec); - str[bpos++] = (char)dec; - } else { - str[bpos++] = instr[ipos++]; - } - } - str[bpos]='\0'; - - /* free extra alloc'ed mem. */ - len = strlen(str); - str = g_renew(char, str, len+1); - - return (str); -} - diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index d4e07c42..53cbe643 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -371,7 +371,7 @@ void twitter_get_home_timeline(struct im_connection *ic, int next_cursor) args[1] = g_strdup_printf ("%d", next_cursor); if (td->home_timeline_id) { args[2] = "since_id"; - args[3] = g_strdup_printf ("%llu", td->home_timeline_id); + args[3] = g_strdup_printf ("%llu", (long long unsigned int) td->home_timeline_id); } twitter_http(TWITTER_HOME_TIMELINE_URL, twitter_http_get_home_timeline, ic, 0, td->user, td->pass, args, td->home_timeline_id ? 4 : 2); |