Skip to content

Commit

Permalink
GetMaxDigits: Fix overflow in Release build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Feb 26, 2022
1 parent 05580af commit 124e94a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,6 @@ StringView Game_Variables::GetName(int _id) const {
}

int Game_Variables::GetMaxDigits() const {
auto val = std::max(std::abs(_max), std::abs(_min));
auto val = std::max(std::llabs(_max), std::llabs(_min));
return static_cast<int>(std::log10(val) + 1);
}

0 comments on commit 124e94a

Please sign in to comment.