mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Merge branch 'master' into 6.x
This commit is contained in:
@@ -36,7 +36,10 @@ struct StdStringTraits {
|
||||
}
|
||||
|
||||
static bool equals(const TString& str, const char* expected) {
|
||||
return 0 == strcmp(str.c_str(), expected);
|
||||
// Arduino's String::c_str() can return NULL
|
||||
const char* actual = str.c_str();
|
||||
if (!actual || !expected) return actual == expected;
|
||||
return 0 == strcmp(actual, expected);
|
||||
}
|
||||
|
||||
static void append(TString& str, char c) {
|
||||
@@ -64,7 +67,7 @@ struct StringTraits<StringSumHelper, void> : StdStringTraits<StringSumHelper> {
|
||||
template <>
|
||||
struct StringTraits<std::string, void> : StdStringTraits<std::string> {};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} // namespace Internals
|
||||
} // namespace ArduinoJson
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user