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

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

View File

@ -18,7 +18,8 @@ class DynamicStringBuilder : public Print {
DynamicStringBuilder(String &str) : _str(str) {}
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;
}