Skip to content

Commit

Permalink
Fix Helpers nul terminator bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
benbuck committed Nov 21, 2024
1 parent 3939554 commit 185bf7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ std::string getWindowText(HWND hwnd)
return std::string();
}

text.resize(res); // remove nul terminator

return text;
}

Expand All @@ -68,6 +70,8 @@ std::string getWindowClassName(HWND hwnd)
return std::string();
}

className.resize(res); // remove nul terminator

return className;
}

Expand Down

0 comments on commit 185bf7a

Please sign in to comment.