From 5ed5aa99acb6b8360df75bb1ce13d4b97ea50538 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Jan 2009 21:20:46 +0100 Subject: 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. --- src/path.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/path.h') 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); -- cgit v1.2.3