Update json_value.cpp

Fixing bug of sending a number that is a bit bigger than max<uint64_t> it returns 0: https://stackoverflow.com/questions/77261400/jsoncpp-do-not-protect-from-uint64-overflow-and-have-weird-behavior/77261716#77261716
This commit is contained in:
YaalLek 2023-11-21 17:27:58 +02:00 committed by GitHub
parent bee2c1010c
commit db53e6d939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ template <typename T> static inline double integerToDouble(T value) {
template <typename T, typename U>
static inline bool InRange(double d, T min, U max) {
return d >= integerToDouble(min) && d <= integerToDouble(max) &&
!(static_cast<T>(d) == min && d != integerToDouble(min));
!(static_cast<T>(d) == min || d != integerToDouble(min));
}
#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)