We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e89c506 commit 98b0550Copy full SHA for 98b0550
src/windows/GetWindows.cpp
@@ -21,8 +21,7 @@ namespace Screen_Capture {
21
if (pid != GetCurrentProcessId()) {
22
auto textlen = GetWindowTextA(hwnd, w.Name, sizeof(w.Name));
23
// clamp the bounds
24
- textlen = std::max(textlen - 1, static_cast<int>(sizeof(w.Name)) - 1);
25
- textlen = std::min(textlen, 0);
+ textlen = std::min(textlen, static_cast<int>(sizeof(w.Name)) - 1) +1;
26
w.Name[textlen] = '\n';
27
}
28
0 commit comments