aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Csomor <laszlocsomor@google.com>2017-12-01 11:09:34 +0100
committerLaszlo Csomor <laszlocsomor@google.com>2017-12-07 15:31:49 +0100
commiteb3bd6ec297b4dff3734c51a159713e559f5c2cf (patch)
tree7f728a5734a51fe6a09236d3d440d582860bc988
parent3f1b1a6da5f1a778ccad46b6f340e82ad4c99209 (diff)
downloadprotobuf-eb3bd6ec297b4dff3734c51a159713e559f5c2cf.tar.gz
protobuf-eb3bd6ec297b4dff3734c51a159713e559f5c2cf.tar.bz2
protobuf-eb3bd6ec297b4dff3734c51a159713e559f5c2cf.zip
io_win32_unittest: fix condition in GetCwdAsUtf8
-rw-r--r--src/google/protobuf/stubs/io_win32_unittest.cc2
1 files changed, 1 insertions, 1 deletions
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<WCHAR> wcs(new WCHAR[size]);
::GetCurrentDirectoryW(size, wcs.get());
// GetCurrentDirectoryA retrieves an Active-Code-Page-encoded text which