From: Max Kellermann Date: Fri, 3 Oct 2008 09:52:13 +0000 (+0200) Subject: charset: pass -1 instead of strlen() X-Git-Tag: v0.12_alpha1~94 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5b706fd865140da002f2e9f7af3b6f459aed115;p=ncmpc.git charset: pass -1 instead of strlen() The GTK charset functions accept "-1" if the parameter is null terminated. --- diff --git a/src/charset.c b/src/charset.c index 095817d..ccfac0e 100644 --- a/src/charset.c +++ b/src/charset.c @@ -71,7 +71,7 @@ utf8_to_locale(const char *utf8str) if (noconvert) return g_strdup(utf8str); - str = g_convert_with_fallback(utf8str, strlen(utf8str), + str = g_convert_with_fallback(utf8str, -1, charset, "utf-8", NULL, NULL, NULL, &error); @@ -98,7 +98,7 @@ locale_to_utf8(const char *localestr) if (noconvert) return g_strdup(localestr); - str = g_convert_with_fallback(localestr, strlen(localestr), + str = g_convert_with_fallback(localestr, -1, "utf-8", charset, NULL, NULL, NULL, &error);