lxdrgen-cpp-win32: fix return value handling

This commit is contained in:
Přemysl Eric Janouch 2023-07-10 09:34:42 +02:00
parent 2edc9c6fd1
commit 62166f9679
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ bool utf8_to_wstring(const uint8_t *utf8, size_t length, std::wstring &wide) {
return false;
wide.resize(size);
return !MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
return !!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS,
(LPCCH) utf8, length, wide.data(), size);
}
@ -40,7 +40,7 @@ bool wstring_to_utf8(const std::wstring &wide, std::string &utf8) {
return false;
utf8.resize(size);
return !WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS,
return !!WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS,
(LPCWCH) wide.data(), wide.size(), utf8.data(), size, NULL, NULL);
}