Skip to content

Commit 98b0550

Browse files
authored
Update GetWindows.cpp
Fix for #68
1 parent e89c506 commit 98b0550

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/windows/GetWindows.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ namespace Screen_Capture {
2121
if (pid != GetCurrentProcessId()) {
2222
auto textlen = GetWindowTextA(hwnd, w.Name, sizeof(w.Name));
2323
// clamp the bounds
24-
textlen = std::max(textlen - 1, static_cast<int>(sizeof(w.Name)) - 1);
25-
textlen = std::min(textlen, 0);
24+
textlen = std::min(textlen, static_cast<int>(sizeof(w.Name)) - 1) +1;
2625
w.Name[textlen] = '\n';
2726
}
2827

0 commit comments

Comments
 (0)