forked from bblanchon/ArduinoJson
Fixed exception when using Flash strings as object keys (fixes #784)
This commit is contained in:
@ -1,6 +1,11 @@
|
|||||||
ArduinoJson: change log
|
ArduinoJson: change log
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
HEAD
|
||||||
|
----
|
||||||
|
|
||||||
|
* Fixed exception when using Flash strings as object keys (issue #784)
|
||||||
|
|
||||||
v6.2.2-beta
|
v6.2.2-beta
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ class FixedSizeFlashString {
|
|||||||
bool equals(const char* expected) const {
|
bool equals(const char* expected) const {
|
||||||
const char* actual = reinterpret_cast<const char*>(_str);
|
const char* actual = reinterpret_cast<const char*>(_str);
|
||||||
if (!actual || !expected) return actual == expected;
|
if (!actual || !expected) return actual == expected;
|
||||||
return strcmp_P(actual, expected) == 0;
|
return strncmp_P(expected, actual, _size) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_null() const {
|
bool is_null() const {
|
||||||
|
@ -14,7 +14,7 @@ class ZeroTerminatedFlashString {
|
|||||||
bool equals(const char* expected) const {
|
bool equals(const char* expected) const {
|
||||||
const char* actual = reinterpret_cast<const char*>(_str);
|
const char* actual = reinterpret_cast<const char*>(_str);
|
||||||
if (!actual || !expected) return actual == expected;
|
if (!actual || !expected) return actual == expected;
|
||||||
return strcmp_P(actual, expected) == 0;
|
return strcmp_P(expected, actual) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_null() const {
|
bool is_null() const {
|
||||||
|
Reference in New Issue
Block a user