1
0
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:
NAKAMURA Takumi 2013-10-07 15:33:30 +00:00
parent 7630608c08
commit e7cfbb5fd1

View File

@ -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;