comparison src/util.c @ 13645:073bc6da6403

[gaim-migrate @ 16043] crashes inform me that g_utf8_strdown and/or g_utf8_normalize can return NULL when the input string is not NULL committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 17 Apr 2006 00:17:00 +0000
parents 68157ab4e1c9
children 9df4a46b0bb3
comparison
equal deleted inserted replaced
13644:d70f4e25eab5 13645:073bc6da6403
2665 2665
2666 g_return_val_if_fail(str != NULL, NULL); 2666 g_return_val_if_fail(str != NULL, NULL);
2667 2667
2668 tmp1 = g_utf8_strdown(str, -1); 2668 tmp1 = g_utf8_strdown(str, -1);
2669 tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT); 2669 tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT);
2670 g_snprintf(buf, sizeof(buf), "%s", tmp2); 2670 g_snprintf(buf, sizeof(buf), "%s", tmp2 ? tmp2 : "");
2671 g_free(tmp2); 2671 g_free(tmp2);
2672 g_free(tmp1); 2672 g_free(tmp1);
2673 2673
2674 return buf; 2674 return buf;
2675 } 2675 }