Changeset 0519b0a for protocols


Ignore:
Timestamp:
2010-04-06T23:54:00Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d569019
Parents:
2abceca
Message:

Killed unused twitter_urldecode() and silence some compiler warnings.

Location:
protocols/twitter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/twitter/twitter_http.c

    r2abceca r0519b0a  
    121121        {
    122122                // Append the Content-Type and url-encoded arguments.
    123                 tmp = g_strdup_printf("%sContent-Type: application/x-www-form-urlencoded\r\nContent-Length: %i\r\n\r\n%s",
     123                tmp = g_strdup_printf("%sContent-Type: application/x-www-form-urlencoded\r\nContent-Length: %zd\r\n\r\n%s",
    124124                                                                request, strlen(url_arguments), url_arguments);
    125125                g_free(request);
     
    160160        return retval;
    161161}
    162 
    163 char *twitter_urldecode(const char *instr)
    164 {
    165         int ipos=0, bpos=0;
    166         char *str = NULL;
    167         char entity[3]={0,0,0};
    168         unsigned dec;
    169         int len = strlen(instr);
    170 
    171         if(!(str = g_new(char, len+1) ))
    172                 return "";
    173 
    174         while(instr[ipos]) {
    175                 while(instr[ipos] && instr[ipos]!='%')
    176                         if(instr[ipos]=='+') {
    177                                 str[bpos++]=' ';
    178                                 ipos++;
    179                         } else
    180                                 str[bpos++] = instr[ipos++];
    181                         if(!instr[ipos])
    182                                 break;
    183 
    184                         if(instr[ipos+1] && instr[ipos+2]) {
    185                                 ipos++;
    186                                 entity[0]=instr[ipos++];
    187                                 entity[1]=instr[ipos++];
    188                                 sscanf(entity, "%2x", &dec);
    189                                 str[bpos++] = (char)dec;
    190                         } else {
    191                                 str[bpos++] = instr[ipos++];
    192                         }
    193                 }
    194         str[bpos]='\0';
    195 
    196         /* free extra alloc'ed mem. */
    197         len = strlen(str);
    198         str = g_renew(char, str, len+1);
    199 
    200         return (str);
    201 }
    202 
  • protocols/twitter/twitter_lib.c

    r2abceca r0519b0a  
    372372        if (td->home_timeline_id) {
    373373                args[2] = "since_id";
    374                 args[3] = g_strdup_printf ("%llu", td->home_timeline_id);
     374                args[3] = g_strdup_printf ("%llu", (long long unsigned int) td->home_timeline_id);
    375375        }
    376376
Note: See TracChangeset for help on using the changeset viewer.