From e2442109438479daf907a0012db8101b8ffc4217 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 11 Feb 2008 10:52:05 +0100 Subject: [PATCH] return the right buffer, iconv modify one --- common/draw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/draw.c b/common/draw.c index c86f6d00b..1e743bb79 100644 --- a/common/draw.c +++ b/common/draw.c @@ -37,7 +37,7 @@ draw_iso2utf8(char *iso) { iconv_t iso2utf8; size_t len, utf8len; - char *utf8; + char *utf8, *utf8p; if(!(len = a_strlen(iso))) return NULL; @@ -58,19 +58,19 @@ draw_iso2utf8(char *iso) } utf8len = (3 * len) / 2 + 1; - utf8 = p_new(char, utf8len); + utf8 = utf8p = p_new(char, utf8len); if(iconv(iso2utf8, &iso, &len, &utf8, &utf8len) == (size_t) -1) { perror("awesome: text conversion failed"); - p_delete(&utf8); + p_delete(&utf8p); return NULL; } if(iconv_close(iso2utf8)) warn("error closing iconv"); - return utf8; + return utf8p; } /** Get a draw context