Skip to content

Commit

Permalink
fix hexadecimal parsing in parseWindow()
Browse files Browse the repository at this point in the history
Due to invalid usage of std::stoi() hexadecimal
values prefixed with "0x" were always parsed
as integers with value of 0.

This fix uses base 0 instead of default base 10,
leading to automatic base detection.
  • Loading branch information
foxpy committed Aug 20, 2021
1 parent 7b5dd66 commit c35fb9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Window parseWindow( std::string win, X11* x11 ) {
Window retwin;
std::string::size_type sz;
try {
retwin = std::stoi(win,&sz);
retwin = std::stoi(win,&sz,0);
} catch ( ... ) {
try {
retwin = std::stoul(win,&sz,16);
Expand Down

0 comments on commit c35fb9b

Please sign in to comment.