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

This commit is contained in:
Benoit Blanchon committed 2019-06-21 08:46:32 +02:00
1 parent 59f9c9747f
commit ce247a5637
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -1,6 +1,11 @@
ArduinoJson: change log ArduinoJson: change log
======================= =======================
HEAD
----
* Fixed `serialized()` not working with Flash strings (issue #1030)
v6.11.0 (2019-05-26) v6.11.0 (2019-05-26)
------- -------
@@ -29,7 +29,7 @@ class SizedFlashStringAdapter {
char* save(MemoryPool* pool) const { char* save(MemoryPool* pool) const {
if (!_str) return NULL; if (!_str) return NULL;
char* dup = pool->allocFrozenString(_size); 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; return dup;
} }