mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 08:48:30 +01:00
Fix unsigned long printed as signed long (issue #170)
This commit is contained in:
@@ -72,8 +72,13 @@ class JsonVariant : public JsonVariantBase<JsonVariant> {
|
||||
typename TypeTraits::EnableIf<TypeTraits::IsIntegral<T>::value>::type * =
|
||||
0) {
|
||||
using namespace Internals;
|
||||
_type = JSON_INTEGER;
|
||||
_content.asInteger = static_cast<JsonInteger>(value);
|
||||
if (value >= 0) {
|
||||
_type = JSON_POSITIVE_INTEGER;
|
||||
_content.asInteger = static_cast<JsonInteger>(value);
|
||||
} else {
|
||||
_type = JSON_NEGATIVE_INTEGER;
|
||||
_content.asInteger = static_cast<JsonInteger>(-value);
|
||||
}
|
||||
}
|
||||
|
||||
// Create a JsonVariant containing a string.
|
||||
|
||||
Reference in New Issue
Block a user