From 5fd02a7a44c42cade5edeeea19c3bcadb2576450 Mon Sep 17 00:00:00 2001 From: barant Date: Thu, 9 Jan 2025 09:04:17 -0800 Subject: [PATCH] Fixed data type on comparisons. --- ZString.cpp | 6 +++--- ZString.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ZString.cpp b/ZString.cpp index acabe6e..8bd5ae0 100644 --- a/ZString.cpp +++ b/ZString.cpp @@ -110,9 +110,9 @@ namespace coreutils { return (strncmp(data, valuex.data, length) == 0); } - bool ZString::operator!=(const ZString &valuex) const { -// if(length != valuex.getLength()) -// return false; + bool ZString::operator!=(const ZString valuex) const { + if(length != valuex.getLength()) + return true; return (strncmp(data, valuex.data, length) != 0); } diff --git a/ZString.h b/ZString.h index 978d338..c7a4836 100644 --- a/ZString.h +++ b/ZString.h @@ -115,7 +115,7 @@ namespace coreutils { bool operator<=(const ZString &valuex) const; bool operator>=(const ZString &valuex) const; bool operator==(const ZString valuex); - bool operator!=(const ZString &valuex) const; + bool operator!=(const ZString valuex) const; bool operator!=(const char *valuex) const; ///