From 355f08a728f73f21e287926c3fded19ed975e40d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 12 Nov 2024 00:48:40 -0500 Subject: [PATCH] Fix argument order in the Windows implementation of `getEnvOs` See the build failure in https://github.com/msys2/MINGW-packages/pull/22499 --- src/libutil/windows/environment-variables.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libutil/windows/environment-variables.cc b/src/libutil/windows/environment-variables.cc index 525d08c64..5ce8a1395 100644 --- a/src/libutil/windows/environment-variables.cc +++ b/src/libutil/windows/environment-variables.cc @@ -13,7 +13,7 @@ std::optional getEnvOs(const OsString & key) } // 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 DWORD resultSize = GetEnvironmentVariableW(key.c_str(), &value[0], bufferSize);