Removed implicit conversion in comparison operators (issue #998)

This commit is contained in:
Benoit Blanchon
2019-05-23 21:54:42 +02:00
parent 4eb8074358
commit 630107ae8a
14 changed files with 398 additions and 148 deletions

View File

@@ -12,10 +12,12 @@ class SizedRamStringAdapter {
public:
SizedRamStringAdapter(const char* str, size_t n) : _str(str), _size(n) {}
int8_t compare(const char* other) const {
return safe_strncmp(_str, other, _size) == 0;
}
bool equals(const char* expected) const {
const char* actual = reinterpret_cast<const char*>(_str);
if (!actual || !expected) return actual == expected;
return strcmp(actual, expected) == 0;
return compare(expected) == 0;
}
bool isNull() const {