Skip to content

Commit

Permalink
Fix argument order in the Windows implementation of getEnvOs
Browse files Browse the repository at this point in the history
See the build failure in msys2/MINGW-packages#22499
  • Loading branch information
Ericson2314 committed Nov 12, 2024
1 parent 76cd80d commit 569e6db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libutil/windows/environment-variables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ std::optional<OsString> 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);
Expand Down

0 comments on commit 569e6db

Please sign in to comment.