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