Skip to content

Commit

Permalink
Update GetWindows.cpp
Browse files Browse the repository at this point in the history
Fix for #68
  • Loading branch information
smasherprog authored Apr 27, 2019
1 parent e89c506 commit 98b0550
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/windows/GetWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace Screen_Capture {
if (pid != GetCurrentProcessId()) {
auto textlen = GetWindowTextA(hwnd, w.Name, sizeof(w.Name));
// clamp the bounds
textlen = std::max(textlen - 1, static_cast<int>(sizeof(w.Name)) - 1);
textlen = std::min(textlen, 0);
textlen = std::min(textlen, static_cast<int>(sizeof(w.Name)) - 1) +1;
w.Name[textlen] = '\n';
}

Expand Down

0 comments on commit 98b0550

Please sign in to comment.