comparison src/util.c @ 11142:ee059fe9b362

[gaim-migrate @ 13206] Who wrote this? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 22 Jul 2005 01:49:19 +0000
parents 096020ae09a9
children 8e600ee6ec61
comparison
equal deleted inserted replaced
11141:7d2dae6e585f 11142:ee059fe9b362
2435 2435
2436 void 2436 void
2437 gaim_str_strip_cr(char *text) 2437 gaim_str_strip_cr(char *text)
2438 { 2438 {
2439 int i, j; 2439 int i, j;
2440 char *text2;
2441 2440
2442 g_return_if_fail(text != NULL); 2441 g_return_if_fail(text != NULL);
2443
2444 text2 = g_malloc(strlen(text) + 1);
2445 2442
2446 for (i = 0, j = 0; text[i]; i++) 2443 for (i = 0, j = 0; text[i]; i++)
2447 if (text[i] != '\r') 2444 if (text[i] != '\r')
2448 text2[j++] = text[i]; 2445 text[j++] = text[i];
2449 text2[j] = '\0'; 2446
2450 2447 text[j++] = '\0';
2451 strcpy(text, text2);
2452 g_free(text2);
2453 } 2448 }
2454 2449
2455 gchar * 2450 gchar *
2456 gaim_strreplace(const char *string, const char *delimiter, 2451 gaim_strreplace(const char *string, const char *delimiter,
2457 const char *replacement) 2452 const char *replacement)