mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
Explicitly cast size_t to integer types
This commit is contained in:
parent
146e43b6ec
commit
d57124d075
14 changed files with 30 additions and 29 deletions
|
@ -1460,8 +1460,9 @@ const std::string& fs::get_config_dir()
|
|||
|
||||
#ifdef _WIN32
|
||||
wchar_t buf[32768];
|
||||
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, std::size(buf)) - 1 >= std::size(buf) - 1 &&
|
||||
GetModuleFileName(NULL, buf, std::size(buf)) - 1 >= std::size(buf) - 1)
|
||||
constexpr DWORD size = static_cast<DWORD>(std::size(buf));
|
||||
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, size) - 1 >= size - 1 &&
|
||||
GetModuleFileName(NULL, buf, size) - 1 >= size - 1)
|
||||
{
|
||||
MessageBoxA(0, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
|
||||
return dir; // empty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue