Mercurial > pidgin
comparison src/html.c @ 4503:fdc4ac6d1db1
[gaim-migrate @ 4778]
strip_html shouldn't segfault when passed NULL
committer: Tailor Script <tailor@pidgin.im>
| author | Nathan Walp <nwalp@pidgin.im> |
|---|---|
| date | Sat, 01 Feb 2003 20:13:27 +0000 |
| parents | 7b0f6537da75 |
| children | d19872836812 |
comparison
equal
deleted
inserted
replaced
| 4502:7a2e45719bd0 | 4503:fdc4ac6d1db1 |
|---|---|
| 47 gchar *strip_html(const gchar *text) | 47 gchar *strip_html(const gchar *text) |
| 48 { | 48 { |
| 49 int i, j, k; | 49 int i, j, k; |
| 50 int visible = 1; | 50 int visible = 1; |
| 51 gchar *text2 = g_strdup(text); | 51 gchar *text2 = g_strdup(text); |
| 52 | |
| 53 g_return_val_if_fail(text != NULL, NULL); | |
| 52 | 54 |
| 53 for (i = 0, j = 0; text2[i]; i++) { | 55 for (i = 0, j = 0; text2[i]; i++) { |
| 54 if (text2[i] == '<') { | 56 if (text2[i] == '<') { |
| 55 k = i + 1; | 57 k = i + 1; |
| 56 while (text2[k]) { | 58 while (text2[k]) { |
