1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-06 07:02:42 +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:
Stuart Gorman
2024-11-21 22:09:29 +10:00
committed by GitHub
parent 378e091795
commit f9f8c07792
2 changed files with 4 additions and 4 deletions

View File

@@ -1256,7 +1256,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0) if (errno != ERANGE)
{ {
value_unsigned = static_cast<number_unsigned_t>(x); value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x) if (value_unsigned == x)
@@ -1272,7 +1272,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0) if (errno != ERANGE)
{ {
value_integer = static_cast<number_integer_t>(x); value_integer = static_cast<number_integer_t>(x);
if (value_integer == x) if (value_integer == x)

View File

@@ -8725,7 +8725,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0) if (errno != ERANGE)
{ {
value_unsigned = static_cast<number_unsigned_t>(x); value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x) if (value_unsigned == x)
@@ -8741,7 +8741,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno == 0) if (errno != ERANGE)
{ {
value_integer = static_cast<number_integer_t>(x); value_integer = static_cast<number_integer_t>(x);
if (value_integer == x) if (value_integer == x)