Fixed value returned by serializeXxx() when writing to a String

This commit is contained in:
Benoit Blanchon
2020-01-14 10:32:52 +01:00
parent 25879466da
commit 3aebef6d0a
4 changed files with 48 additions and 2 deletions

View File

@ -22,9 +22,8 @@ class Writer< ::String, void> {
// CAUTION: Arduino String doesn't have append()
// and old version doesn't have size() either
_str->reserve(_str->length() + n);
while (n > 0) {
for (size_t i = 0; i < n; i++) {
_str->operator+=(static_cast<char>(*s++));
n--;
}
return n;
}