Fixed erroneous operator== on ZString.
This commit is contained in:
1 parent
34e2ca0566
commit
d0239074a4
3 files changed
+6
-14
No files matched your search
+3
-13
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user