aboutsummaryrefslogtreecommitdiff
path: root/src/util/string.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-11-03 17:28:16 +0100
committersapier <Sapier at GMX dot net>2013-11-11 19:56:49 +0100
commit22a59b3912ff5e7bb1516faa06f1841545a8117c (patch)
treefa4e98374808d149b41ad7251425d6cab61dd918 /src/util/string.cpp
parent0f9440fa61fbfd95b0c06217d08b07c81c897ee0 (diff)
downloadminetest-22a59b3912ff5e7bb1516faa06f1841545a8117c.tar.gz
minetest-22a59b3912ff5e7bb1516faa06f1841545a8117c.tar.bz2
minetest-22a59b3912ff5e7bb1516faa06f1841545a8117c.zip
Fix win32/msvc i18n (quite UGLY version, blame Microsoft)
Diffstat (limited to 'src/util/string.cpp')
-rw-r--r--src/util/string.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/string.cpp b/src/util/string.cpp
index a2312baf8..39a14598b 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -41,8 +41,9 @@ std::string wide_to_narrow(const std::wstring& wcs)
size_t mbl = wcs.size()*4;
SharedBuffer<char> mbs(mbl+1);
size_t l = wcstombs(*mbs, wcs.c_str(), mbl);
- if(l == (size_t)(-1))
- mbs[0] = 0;
+ if(l == (size_t)(-1)) {
+ return "Character conversion failed!";
+ }
else
mbs[l] = 0;
return *mbs;