[draw] Allow more space for characters conversion
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
5e6760c589
commit
038e52c699
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue