diff --git a/src/json.hpp b/src/json.hpp index e64484e3..ff409559 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -10619,7 +10619,7 @@ basic_json_parser_66: // skip if definitely not an integer if (type != value_t::number_float) { - auto digit = *curptr - '0'; + auto digit = static_cast(*curptr - '0'); // overflow if value * 10 + digit > max, move terms around // to avoid overflow in intermediate values diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 57c502d3..4366fe6d 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -9769,7 +9769,7 @@ class basic_json // skip if definitely not an integer if (type != value_t::number_float) { - auto digit = *curptr - '0'; + auto digit = static_cast(*curptr - '0'); // overflow if value * 10 + digit > max, move terms around // to avoid overflow in intermediate values