diff options
author | Max Kellermann <max@duempel.org> | 2009-01-08 21:20:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-08 21:20:46 +0100 |
commit | 5ed5aa99acb6b8360df75bb1ce13d4b97ea50538 (patch) | |
tree | 518a01dabc3c9652fdbb090eb4e8fd97ed725729 /src/path.h | |
parent | f0980283bcce8ad7819f71bc49b973e28e54b22d (diff) | |
download | mpd-5ed5aa99acb6b8360df75bb1ce13d4b97ea50538.tar.gz mpd-5ed5aa99acb6b8360df75bb1ce13d4b97ea50538.tar.xz mpd-5ed5aa99acb6b8360df75bb1ce13d4b97ea50538.zip |
path: allocate buffer in fs_charset conversion functions
Don't use fixed static buffers. GLib allocates a new string for us
anyway, let's just return this one instead of copying it.
Diffstat (limited to 'src/path.h')
-rw-r--r-- | src/path.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/path.h b/src/path.h index 3bb088b5f..1dbdd7820 100644 --- a/src/path.h +++ b/src/path.h @@ -36,9 +36,19 @@ void path_global_init(void); void path_global_finish(void); -char *fs_charset_to_utf8(char *dst, const char *str); +/** + * Converts a file name in the filesystem charset to UTF-8. Returns + * NULL on failure. + */ +char * +fs_charset_to_utf8(const char *path_fs); -char *utf8_to_fs_charset(char *dst, const char *str); +/** + * Converts a file name in UTF-8 to the filesystem charset. Returns a + * duplicate of the UTF-8 string on failure. + */ +char * +utf8_to_fs_charset(const char *path_utf8); void path_set_fs_charset(const char *charset); |