comparison src/util.c @ 8088:a86784e3b98c

[gaim-migrate @ 8787] ints and chars, living in harmony committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Tue, 13 Jan 2004 01:00:24 +0000
parents 9b6bc1010054
children 52089b055c12
comparison
equal deleted inserted replaced
8087:b00d7fe62596 8088:a86784e3b98c
249 **************************************************************************/ 249 **************************************************************************/
250 void 250 void
251 gaim_quotedp_decode(const char *str, char **ret_str, int *ret_len) 251 gaim_quotedp_decode(const char *str, char **ret_str, int *ret_len)
252 { 252 {
253 char *p, *n, *new; 253 char *p, *n, *new;
254 int i;
254 255
255 n = new = g_malloc(strlen (str) + 1); 256 n = new = g_malloc(strlen (str) + 1);
256 257
257 for (p = (char *)str; *p; p++, n++) { 258 for (p = (char *)str; *p; p++, n++) {
258 if (*p == '=') { 259 if (*p == '=') {
259 sscanf(p + 1, "%2x\n", (int *)n); 260 sscanf(p + 1, "%2x\n", &i);
261 *n = (char)i;
260 p += 2; 262 p += 2;
261 } 263 }
262 else if (*p == '_') 264 else if (*p == '_')
263 *n = ' '; 265 *n = ' ';
264 else 266 else