From eb3bd6ec297b4dff3734c51a159713e559f5c2cf Mon Sep 17 00:00:00 2001 From: Laszlo Csomor Date: Fri, 1 Dec 2017 11:09:34 +0100 Subject: io_win32_unittest: fix condition in GetCwdAsUtf8 --- src/google/protobuf/stubs/io_win32_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/google/protobuf/stubs') diff --git a/src/google/protobuf/stubs/io_win32_unittest.cc b/src/google/protobuf/stubs/io_win32_unittest.cc index d277ad6e..710548a2 100644 --- a/src/google/protobuf/stubs/io_win32_unittest.cc +++ b/src/google/protobuf/stubs/io_win32_unittest.cc @@ -130,7 +130,7 @@ bool GetEnvVarAsUtf8(const WCHAR* name, string* result) { bool GetCwdAsUtf8(string* result) { DWORD size = ::GetCurrentDirectoryW(0, NULL); - if (size == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + if (size > 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { scoped_array wcs(new WCHAR[size]); ::GetCurrentDirectoryW(size, wcs.get()); // GetCurrentDirectoryA retrieves an Active-Code-Page-encoded text which -- cgit v1.2.3