Fixed printTo(String) which wrote numbers instead of strings (issue #120)

This commit is contained in:
Benoit Blanchon committed 2015-09-19 16:23:09 +02:00
1 parent b5c8cd1766
commit 155dd653e7
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ ArduinoJson: change log
v5.0.3 v5.0.3
------ ------
* Nothing yet. * Fixed `printTo(String)` which wrote numbers instead of strings (issue #120)
v5.0.2 v5.0.2
------ ------
@@ -18,7 +18,8 @@ class DynamicStringBuilder : public Print {
DynamicStringBuilder(String &str) : _str(str) {} DynamicStringBuilder(String &str) : _str(str) {}
virtual size_t write(uint8_t c) { virtual size_t write(uint8_t c) {
_str += c; // Need to cast to char, otherwise String will print a number (issue #120)
_str += static_cast<char>(c);
return 1; return 1;
} }