Fix the operator != on ZString.

This commit is contained in:
Brad Arant committed 2022-08-05 00:28:58 +00:00
1 parent d38b7f0c55
commit d1c38dcfc8
5 files changed
+15 -3

No files matched your search

+6 -2
View File
@@ -69,12 +69,16 @@ namespace coreutils {
}
bool ZString::operator!=(const ZString &valuex) const {
return (strncmp(data, valuex.data, valuex.length <= length ? valuex.length : length) != 0);
// if(length != valuex.getLength())
// return false;
return (strncmp(data, valuex.data, length) != 0);
}
bool ZString::operator!=(const char *valuex) const {
size_t len = strlen(valuex);
return (strncmp(data, valuex, len <= length ? len : length) != 0);
if(length != len)
return true;
return (strncmp(data, valuex, length) != 0);
}
std::vector<ZString> &ZString::getList() {