comparison src/util.c @ 7722:db1542e84ee6

[gaim-migrate @ 8367] let's not allocate from one pool, and free to another, eh? committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 03 Dec 2003 07:12:59 +0000
parents 1363f91da9cc
children 622c9149609c
comparison
equal deleted inserted replaced
7721:20d0c025312a 7722:db1542e84ee6
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 254
255 n = new = malloc(strlen (str)); 255 n = new = g_malloc(strlen (str));
256 256
257 for (p = (char *)str; *p; p++, n++) { 257 for (p = (char *)str; *p; p++, n++) {
258 if (*p == '=') { 258 if (*p == '=') {
259 sscanf(p + 1, "%2x\n", (int *)n); 259 sscanf(p + 1, "%2x\n", (int *)n);
260 p += 2; 260 p += 2;
267 267
268 *n = '\0'; 268 *n = '\0';
269 269
270 if (ret_len) 270 if (ret_len)
271 *ret_len = n - new; 271 *ret_len = n - new;
272 272
273 /* Resize to take less space */ 273 /* Resize to take less space */
274 /* new = realloc(new, n - new); */ 274 /* new = realloc(new, n - new); */
275 275
276 *ret_str = new; 276 *ret_str = new;
277 } 277 }
307 char *cur, *mark; 307 char *cur, *mark;
308 char *unencoded_start, *unencoded_end; 308 char *unencoded_start, *unencoded_end;
309 char *charset, *encoding, *word, *decoded; 309 char *charset, *encoding, *word, *decoded;
310 char *n, *new; 310 char *n, *new;
311 311
312 n = new = malloc(strlen(str)); 312 n = new = g_malloc(strlen(str));
313 charset = word = NULL; 313 charset = word = NULL;
314 314
315 /* Here we will be looking for encoded words and if they seem to be 315 /* Here we will be looking for encoded words and if they seem to be
316 * valid then decode them */ 316 * valid then decode them */
317 317