mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Fix win32/msvc i18n (quite UGLY version, blame Microsoft)
This commit is contained in:
@@ -197,6 +197,7 @@ public:
|
||||
else
|
||||
data = NULL;
|
||||
refcount = new unsigned int;
|
||||
memset(data,0,sizeof(T)*m_size);
|
||||
(*refcount) = 1;
|
||||
}
|
||||
SharedBuffer(const SharedBuffer &buffer)
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user