summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/str.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/str.cpp b/common/str.cpp
index 304cd88..ee1b35c 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -198,7 +198,7 @@ int String::CompareNoCase(const char *string, int count) const
{
char c1, c2, *ch = m_pData;
- while (*ch && *string && count)
+ while (*ch && *string)
{
c1 = tolower (*ch);
c2 = tolower (*string);
@@ -209,6 +209,9 @@ int String::CompareNoCase(const char *string, int count) const
ch++;
string++;
count--;
+
+ if (!count)
+ return 0;
}
return (((int)*ch) - ((int)*string));