comparison src/util.c @ 13940:fe1c92e1494a

[gaim-migrate @ 16475] Fix a bug where the last character of the value returned by gaim_strdup_withhtml would be cut off. I accidentally introduced this bug in my change a day or two ago. My bad! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 10 Jul 2006 06:59:27 +0000
parents e18155a11d1c
children 8bda65b88e49
comparison
equal deleted inserted replaced
13939:5d5c84239eea 13940:fe1c92e1494a
2682 gchar *dest; 2682 gchar *dest;
2683 2683
2684 g_return_val_if_fail(src != NULL, NULL); 2684 g_return_val_if_fail(src != NULL, NULL);
2685 2685
2686 /* New length is (length of src) + (number of \n's * 3) - (number of \r's) + 1 */ 2686 /* New length is (length of src) + (number of \n's * 3) - (number of \r's) + 1 */
2687 destsize = 0; 2687 destsize = 1;
2688 for (i = 0, j = 0; src[i] != '\0'; i++) 2688 for (i = 0; src[i] != '\0'; i++)
2689 { 2689 {
2690 if (src[i] == '\n') 2690 if (src[i] == '\n')
2691 destsize += 4; 2691 destsize += 4;
2692 else if (src[i] != '\r') 2692 else if (src[i] != '\r')
2693 destsize++; 2693 destsize++;