mirror of
https://github.com/nlohmann/json.git
synced 2025-07-31 10:24:23 +03:00
fix: integer parsed as float when EINTR set in errno (#4506)
* fix: integer parsed as float when EINTR set in errno * chore: make amalgamate * chore: make pretty --------- Co-authored-by: Stuart Gorman <Stuart.Gorman@kallipr.com>
This commit is contained in:
@ -8725,7 +8725,7 @@ scan_number_done:
|
||||
// we checked the number format before
|
||||
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
|
||||
|
||||
if (errno == 0)
|
||||
if (errno != ERANGE)
|
||||
{
|
||||
value_unsigned = static_cast<number_unsigned_t>(x);
|
||||
if (value_unsigned == x)
|
||||
@ -8741,7 +8741,7 @@ scan_number_done:
|
||||
// we checked the number format before
|
||||
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
|
||||
|
||||
if (errno == 0)
|
||||
if (errno != ERANGE)
|
||||
{
|
||||
value_integer = static_cast<number_integer_t>(x);
|
||||
if (value_integer == x)
|
||||
|
Reference in New Issue
Block a user