Просмотр исходного кода

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

Benoit Blanchon 6 лет назад
Родитель
Сommit
ce247a5637
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      CHANGELOG.md
  2. 1 1
      src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp

+ 5 - 0
CHANGELOG.md

@@ -1,6 +1,11 @@
 ArduinoJson: change log
 =======================
 
+HEAD
+----
+
+* Fixed `serialized()` not working with Flash strings (issue #1030)
+
 v6.11.0 (2019-05-26)
 -------
 

+ 1 - 1
src/ArduinoJson/Strings/SizedFlashStringAdapter.hpp

@@ -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;
   }