Fix argument order in the Windows implementation of getEnvOs

See the build failure in https://github.com/msys2/MINGW-packages/pull/22499
This commit is contained in:
John Ericson 2024-11-12 00:48:40 -05:00
parent fa4bd39c6a
commit 355f08a728

View File

@ -13,7 +13,7 @@ std::optional<OsString> getEnvOs(const OsString & key)
} }
// Allocate a buffer to hold the environment variable value // Allocate a buffer to hold the environment variable value
std::wstring value{L'\0', bufferSize}; std::wstring value{bufferSize, L'\0'};
// Retrieve the environment variable value // Retrieve the environment variable value
DWORD resultSize = GetEnvironmentVariableW(key.c_str(), &value[0], bufferSize); DWORD resultSize = GetEnvironmentVariableW(key.c_str(), &value[0], bufferSize);