- Timestamp:
- 2010-04-06T23:54:00Z (15 years ago)
- Branches:
- master
- Children:
- d569019
- Parents:
- 2abceca
- Location:
- protocols/twitter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_http.c
r2abceca r0519b0a 121 121 { 122 122 // 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", 124 124 request, strlen(url_arguments), url_arguments); 125 125 g_free(request); … … 160 160 return retval; 161 161 } 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 } else180 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 372 372 if (td->home_timeline_id) { 373 373 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); 375 375 } 376 376
Note: See TracChangeset
for help on using the changeset viewer.