We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cacab33 + 24fbb45 commit d1b21e8Copy full SHA for d1b21e8
src/libutil/windows/environment-variables.cc
@@ -13,8 +13,10 @@ std::optional<OsString> getEnvOs(const OsString & key)
13
return std::nullopt;
14
}
15
16
- // Allocate a buffer to hold the environment variable value
17
- std::wstring value{bufferSize, L'\0'};
+ /* Allocate a buffer to hold the environment variable value.
+ WARNING: Do not even think about using uniform initialization here,
18
+ we DONT want to call the initializer list ctor accidentally. */
19
+ std::wstring value(bufferSize, L'\0');
20
21
// Retrieve the environment variable value
22
DWORD resultSize = GetEnvironmentVariableW(key.c_str(), &value[0], bufferSize);
0 commit comments