mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
Merge pull request #11856 from nix-windows/fix-windows-env-var-arg-order
[Backport 2.25] Fix argument order in the Windows implementation of `getEnvOs`
This commit is contained in:
commit
6b96c66302
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user