io_win32_unittest: fix condition in GetCwdAsUtf8

pull/4013/head
Laszlo Csomor 7 years ago
parent 3f1b1a6da5
commit eb3bd6ec29
  1. 2
      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<WCHAR> wcs(new WCHAR[size]);
::GetCurrentDirectoryW(size, wcs.get());
// GetCurrentDirectoryA retrieves an Active-Code-Page-encoded text which

Loading…
Cancel
Save