Index: chrome_frame/test/win_event_receiver.cc |
=================================================================== |
--- chrome_frame/test/win_event_receiver.cc (revision 107404) |
+++ chrome_frame/test/win_event_receiver.cc (working copy) |
@@ -169,8 +169,8 @@ |
std::string WindowWatchdog::GetWindowCaption(HWND hwnd) { |
std::string caption; |
int len = ::GetWindowTextLength(hwnd) + 1; |
- ::GetWindowTextA(hwnd, WriteInto(&caption, len), len); |
- |
+ if (len > 1) |
+ ::GetWindowTextA(hwnd, WriteInto(&caption, len), len); |
return caption; |
} |