check iso2utf8 return

This commit is contained in:
Julien Danjou 2008-02-11 08:49:10 +01:00
parent 72d68b13a3
commit fbce780003
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,8 @@ draw_text(DrawCtx *ctx,
/* copy text to buffer */
buf = a_strdup(text);
/* try to convert it to UTF-8 */
buf = draw_iso2utf8(buf);
if(!(buf = draw_iso2utf8(buf)))
return;
/* check that the text is not too long */
while(len && (nw = (draw_textwidth(ctx->display, font, buf)) + padding * 2) > area.width)