aboutsummaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-07 13:22:45 +0100
committerMax Kellermann <max@duempel.org>2008-11-07 13:22:45 +0100
commite67c9454f910f1d202da8d84dc33adec689ae815 (patch)
tree295c43dee84c4efb4bdc3140d06e58b0dafa9839 /src/charset.c
parent25a07c795fdf275b85ccc3b6634f645a0eb1127e (diff)
downloadmpd-e67c9454f910f1d202da8d84dc33adec689ae815.tar.gz
mpd-e67c9454f910f1d202da8d84dc33adec689ae815.tar.xz
mpd-e67c9454f910f1d202da8d84dc33adec689ae815.zip
charset: don't allocate GError
Since the GError return value of g_convert_*() is ignored by ncmpc, we don't need to retrieve it at all.
Diffstat (limited to '')
-rw-r--r--src/charset.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/charset.c b/src/charset.c
index 5625f1277..a0e8bbda4 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -64,7 +64,6 @@ utf8_to_locale(const char *utf8str)
{
#ifdef HAVE_LOCALE_H
gchar *str;
- GError *error;
assert(utf8str != NULL);
@@ -73,12 +72,9 @@ utf8_to_locale(const char *utf8str)
str = g_convert_with_fallback(utf8str, -1,
charset, "utf-8",
- NULL, NULL, NULL,
- &error);
- if (str == NULL) {
- g_error_free(error);
+ NULL, NULL, NULL, NULL);
+ if (str == NULL)
return g_strdup(utf8str);
- }
return str;
#else
@@ -91,7 +87,6 @@ locale_to_utf8(const char *localestr)
{
#ifdef HAVE_LOCALE_H
gchar *str;
- GError *error;
assert(localestr != NULL);
@@ -100,12 +95,9 @@ locale_to_utf8(const char *localestr)
str = g_convert_with_fallback(localestr, -1,
"utf-8", charset,
- NULL, NULL, NULL,
- &error);
- if (str == NULL) {
- g_error_free(error);
+ NULL, NULL, NULL, NULL);
+ if (str == NULL)
return g_strdup(localestr);
- }
return str;
#else