From aab9bbbb937ca594dba479d8efa1aa4a7aedf3ed Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 7 Dec 2016 21:24:42 +0100 Subject: [PATCH] :bug: fix for CBOR (small integers) --- src/json.hpp | 4 ++-- src/json.hpp.re2c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 88266699..7b287f02 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -6514,7 +6514,7 @@ class basic_json // CBOR does not differentiate between positive signed // integers and unsigned integers. Therefore, we used the // code from the value_t::number_unsigned case here. - if (j.m_value.number_integer < 0x17) + if (j.m_value.number_integer <= 0x17) { add_to_vector(v, 1, j.m_value.number_integer); } @@ -6582,7 +6582,7 @@ class basic_json case value_t::number_unsigned: { - if (j.m_value.number_unsigned < 0x17) + if (j.m_value.number_unsigned <= 0x17) { v.push_back(static_cast(j.m_value.number_unsigned)); } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 027218ee..131ea86d 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -6514,7 +6514,7 @@ class basic_json // CBOR does not differentiate between positive signed // integers and unsigned integers. Therefore, we used the // code from the value_t::number_unsigned case here. - if (j.m_value.number_integer < 0x17) + if (j.m_value.number_integer <= 0x17) { add_to_vector(v, 1, j.m_value.number_integer); } @@ -6582,7 +6582,7 @@ class basic_json case value_t::number_unsigned: { - if (j.m_value.number_unsigned < 0x17) + if (j.m_value.number_unsigned <= 0x17) { v.push_back(static_cast(j.m_value.number_unsigned)); }