Fixed erroneous operator== on ZString.

This commit is contained in:
Brad Arant committed 2024-10-16 11:37:18 -07:00
1 parent 34e2ca0566
commit d0239074a4
3 files changed
+6 -14

No files matched your search

+3 -13
View File
@@ -104,22 +104,12 @@ namespace coreutils {
return (strncmp(data, valuex.data, valuex.length <= length ? valuex.length : length) > 0);
}
bool ZString::operator==(const ZString &valuex) {
if((valuex.getLength() == 0) && (length != 0))
return false;
bool ZString::operator==(const ZString valuex) {
if(valuex.getLength() != length)
return false;
return (strncmp(data, valuex.data, valuex.length <= length ? valuex.length : length) == 0);
}
// bool ZString::operator==(std::string value) {
// if(value.length() != length)
// return false;
// return (strncmp(data, value.c_str(), length) == 0);
// }
// bool ZString::operator==(const char *valuex) const {
// return (strncmp(data, valuex, length) == 0);
// }
bool ZString::operator!=(const ZString &valuex) const {
// if(length != valuex.getLength())
// return false;