mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Fixed undefined behavior in JSON serializer
This commit is contained in:
@@ -92,9 +92,9 @@ class TextFormatter {
|
||||
unsigned_type unsigned_value;
|
||||
if (value < 0) {
|
||||
writeRaw('-');
|
||||
unsigned_value = static_cast<unsigned_type>(-value);
|
||||
unsigned_value = unsigned_type(unsigned_type(~value) + 1);
|
||||
} else {
|
||||
unsigned_value = static_cast<unsigned_type>(value);
|
||||
unsigned_value = unsigned_type(value);
|
||||
}
|
||||
writeInteger(unsigned_value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user