diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-03-17 10:02:26 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-03-17 10:02:26 +0000 |
commit | 959bdb992afe0d2964381255da7f7eab6aa9de61 (patch) | |
tree | 37d5b8594be5d15c91faa9e34525b6938e938650 /src/html.c | |
parent | 6127a936645cf2d2d4fcdfd1461f4d1f7268a3b7 (diff) |
made every code conversion API allocate new memory.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@180 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/html.c')
-rw-r--r-- | src/html.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -225,7 +225,7 @@ gchar *html_parse(HTMLParser *parser) static HTMLState html_read_line(HTMLParser *parser) { gchar buf[HTMLBUFSIZE]; - gchar buf2[HTMLBUFSIZE]; + gchar *conv_str; gint index; if (fgets(buf, sizeof(buf), parser->fp) == NULL) { @@ -233,11 +233,13 @@ static HTMLState html_read_line(HTMLParser *parser) return HTML_EOF; } - if (conv_convert(parser->conv, buf2, sizeof(buf2), buf) < 0) { + conv_str = conv_convert(parser->conv, buf); + if (!conv_str) { index = parser->bufp - parser->buf->str; - conv_utf8todisp(buf2, sizeof(buf2), buf); - g_string_append(parser->buf, buf2); + conv_str = conv_utf8todisp(buf); + g_string_append(parser->buf, conv_str); + g_free(conv_str); parser->bufp = parser->buf->str + index; @@ -246,7 +248,8 @@ static HTMLState html_read_line(HTMLParser *parser) index = parser->bufp - parser->buf->str; - g_string_append(parser->buf, buf2); + g_string_append(parser->buf, conv_str); + g_free(conv_str); parser->bufp = parser->buf->str + index; |