Index: snapshot/win/process_reader_win.cc |
diff --git a/snapshot/win/process_reader_win.cc b/snapshot/win/process_reader_win.cc |
index a10588862f299d1c621307586f56e80d15b9a433..373124d61930f04e3fed8c82f6f0735362eaef7f 100644 |
--- a/snapshot/win/process_reader_win.cc |
+++ b/snapshot/win/process_reader_win.cc |
@@ -86,10 +86,13 @@ process_types::SYSTEM_PROCESS_INFORMATION<Traits>* GetProcessInformation( |
reinterpret_cast<process_types::SYSTEM_PROCESS_INFORMATION<Traits>*>( |
buffer->get()); |
DWORD process_id = GetProcessId(process_handle); |
- do { |
+ for (;;) { |
if (process->UniqueProcessId == process_id) |
return process; |
- } while (process = NextProcess(process)); |
+ process = NextProcess(process); |
+ if (!process) |
+ break; |
+ } |
LOG(ERROR) << "process " << process_id << " not found"; |
return nullptr; |