diff options
author | Max Kellermann <max@duempel.org> | 2013-10-17 22:39:06 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-17 22:39:06 +0200 |
commit | f951e5356b7b6fb1126e367e641882f1e5192f76 (patch) | |
tree | 6e25ea9d361194ce4e70cc642ec840c8da7b1e8c /src/fs/Charset.cxx | |
parent | 080ee87e07f0037e559abbea6f7db73602af5137 (diff) |
fs/Charset: don't allow nullptr arguments
Diffstat (limited to 'src/fs/Charset.cxx')
-rw-r--r-- | src/fs/Charset.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fs/Charset.cxx b/src/fs/Charset.cxx index 5a06bf949..b75001043 100644 --- a/src/fs/Charset.cxx +++ b/src/fs/Charset.cxx @@ -79,8 +79,7 @@ GetFSCharset() std::string PathToUTF8(const char *path_fs) { - if (path_fs == nullptr) - return std::string(); + assert(path_fs != nullptr); GIConv conv = g_iconv_open("utf-8", fs_charset.c_str()); if (conv == reinterpret_cast<GIConv>(-1)) @@ -107,6 +106,8 @@ PathToUTF8(const char *path_fs) char * PathFromUTF8(const char *path_utf8) { + assert(path_utf8 != nullptr); + return g_convert(path_utf8, -1, fs_charset.c_str(), "utf-8", nullptr, nullptr, nullptr); |