git repos / PlatformFolders

commit 75270a86

Poul Sander · 2019-05-14 21:55
75270a86fcc6a8cc395853de336d92b947be6411 patch · browse files
parent 34cc125ea75d791eb7e4253c65ebf79985ec8b66
parent db2a9b624e0cd92a680b56c718e3ec7b8956196f

Merge pull request #19 from domenn/master

Fix warning on MSVC for different types

Changed files

M sago/platform_folders.cpp before
diff --git a/sago/platform_folders.cpp b/sago/platform_folders.cpp index 5f419f1..1531e91 100644 --- a/sago/platform_folders.cpp +++ b/sago/platform_folders.cpp
@@ -98,7 +98,7 @@ std::string win32_utf16_to_utf8(const wchar_t* wstr) {
if (actualSize > 0) {
//If the converted UTF-8 string could not be in the initial buffer. Allocate one that can hold it.
std::vector<char> buffer(actualSize);
- actualSize = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, &buffer[0], buffer.size(), nullptr, nullptr);
+ actualSize = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, &buffer[0], static_cast<int>(buffer.size()), nullptr, nullptr);
res = buffer.data();
}
if (actualSize == 0) {