Skip to content

Commit

Permalink
Merge pull request #11855 from nix-windows/fix-windows-env-var-arg-order
Browse files Browse the repository at this point in the history
Fix argument order in the Windows implementation of `getEnvOs`
  • Loading branch information
edolstra authored Nov 12, 2024
2 parents 76cd80d + 355f08a commit 2e2198f
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 2e2198f

Please sign in to comment.