BUGFIX: String comparison operations

Corrected response of < and > operations where substrings are compared.
This commit is contained in:
Joe Finney 2015-11-17 17:20:30 +00:00
parent 9b5fa0fcfc
commit b44095f0c5

View file

@ -263,7 +263,7 @@ ManagedString& ManagedString::operator = (const ManagedString& s)
*/
bool ManagedString::operator== (const ManagedString& s)
{
return ((length() == s.length()) && (memcmp(toCharArray(),s.toCharArray(),s.length())==0));
return ((length() == s.length()) && (strcmp(toCharArray(),s.toCharArray())==0));
}
/**
@ -287,7 +287,7 @@ bool ManagedString::operator== (const ManagedString& s)
*/
bool ManagedString::operator< (const ManagedString& s)
{
return (memcmp(toCharArray(), s.toCharArray(), min(length(),s.length()))<0);
return (strcmp(toCharArray(), s.toCharArray())<0);
}
/**
@ -311,7 +311,7 @@ bool ManagedString::operator< (const ManagedString& s)
*/
bool ManagedString::operator> (const ManagedString& s)
{
return (memcmp(toCharArray(), s.toCharArray(), min(length(),s.length()))>0);
return (strcmp(toCharArray(), s.toCharArray())>0);
}
/**