mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 08:48:27 +01:00
Removed implicit conversion in comparison operators (issue #998)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
#include <string.h> // strcmp
|
||||
#include "../Polyfills/safe_strcmp.hpp"
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
@@ -13,10 +14,12 @@ class ConstRamStringAdapter {
|
||||
public:
|
||||
ConstRamStringAdapter(const char* str = 0) : _str(str) {}
|
||||
|
||||
int8_t compare(const char* other) const {
|
||||
return safe_strcmp(_str, other);
|
||||
}
|
||||
|
||||
bool equals(const char* expected) const {
|
||||
const char* actual = _str;
|
||||
if (!actual || !expected) return actual == expected;
|
||||
return strcmp(actual, expected) == 0;
|
||||
return compare(expected) == 0;
|
||||
}
|
||||
|
||||
bool isNull() const {
|
||||
|
||||
Reference in New Issue
Block a user