diff options
author | Max Kellermann <max@duempel.org> | 2009-01-04 19:50:22 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-04 19:50:22 +0100 |
commit | 530f0b71de6d0e44911528eb4e256d165ed77c31 (patch) | |
tree | ec16d3a8c11d6fa6617e7adbe110447912188230 /src/path.c | |
parent | da693822730d1712d44da85389e4d8b659b3b5df (diff) | |
download | mpd-530f0b71de6d0e44911528eb4e256d165ed77c31.tar.gz mpd-530f0b71de6d0e44911528eb4e256d165ed77c31.tar.xz mpd-530f0b71de6d0e44911528eb4e256d165ed77c31.zip |
path, tag: don't allocate GError for charset conversion
Pass NULL instead of &error to g_convert(). We're not interested in
the error object.
Diffstat (limited to '')
-rw-r--r-- | src/path.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/path.c b/src/path.c index 2698957f7..88ac9382e 100644 --- a/src/path.c +++ b/src/path.c @@ -32,16 +32,13 @@ static char *fs_charset; char *fs_charset_to_utf8(char *dst, const char *str) { gchar *p; - GError *error = NULL; p = g_convert(str, -1, "utf-8", fs_charset, - NULL, NULL, &error); - if (p == NULL) { + NULL, NULL, NULL); + if (p == NULL) /* no fallback */ - g_error_free(error); return NULL; - } g_strlcpy(dst, p, MPD_PATH_MAX); g_free(p); @@ -51,16 +48,13 @@ char *fs_charset_to_utf8(char *dst, const char *str) char *utf8_to_fs_charset(char *dst, const char *str) { gchar *p; - GError *error = NULL; p = g_convert(str, -1, fs_charset, "utf-8", - NULL, NULL, &error); - if (p == NULL) { + NULL, NULL, NULL); + if (p == NULL) /* fall back to UTF-8 */ - g_error_free(error); return strcpy(dst, str); - } g_strlcpy(dst, p, MPD_PATH_MAX); g_free(p); |