Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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