Fixed serialized() not working with Flash strings (fixes #1030)

This commit is contained in:
Benoit Blanchon
2019-06-21 08:46:05 +02:00
parent 59f9c9747f
commit ce247a5637
2 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class SizedFlashStringAdapter {
char* save(MemoryPool* pool) const {
if (!_str) return NULL;
char* dup = pool->allocFrozenString(_size);
if (!dup) memcpy_P(dup, (const char*)_str, _size);
if (dup) memcpy_P(dup, (const char*)_str, _size);
return dup;
}