mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Windows/Process.inc: Fix for +Asserts. &Buf[0] is not guaranteed if size is zero.
llvm-svn: 192103
This commit is contained in:
parent
7630608c08
commit
e7cfbb5fd1
@ -161,7 +161,7 @@ Optional<std::string> Process::GetEnv(StringRef Name) {
|
||||
SmallVector<wchar_t, MAX_PATH> Buf;
|
||||
size_t Size = MAX_PATH;
|
||||
do {
|
||||
Buf.reserve(Size);
|
||||
Buf.resize(Size);
|
||||
Size = GetEnvironmentVariableW(&NameUTF16[0], &Buf[0], Buf.capacity());
|
||||
if (Size == 0)
|
||||
return None;
|
||||
|
Loading…
Reference in New Issue
Block a user