[draw] Allow more space for characters conversion

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-04 11:07:57 +02:00
parent 5e6760c589
commit 038e52c699
1 changed files with 1 additions and 2 deletions

View File

@ -65,14 +65,13 @@ draw_iso2utf8(char *iso)
return NULL; return NULL;
} }
utf8len = (3 * len) / 2 + 1; utf8len = 2 * len + 1;
utf8 = utf8p = p_new(char, utf8len); utf8 = utf8p = p_new(char, utf8len);
if(iconv(iso2utf8, &iso, &len, &utf8, &utf8len) == (size_t) -1) if(iconv(iso2utf8, &iso, &len, &utf8, &utf8len) == (size_t) -1)
{ {
warn("text conversion failed: %s\n", strerror(errno)); warn("text conversion failed: %s\n", strerror(errno));
p_delete(&utf8p); p_delete(&utf8p);
return NULL;
} }
if(iconv_close(iso2utf8)) if(iconv_close(iso2utf8))