diff --git a/include/strings.h b/include/strings.h index 7d9fcae20..fe1070f50 100755 --- a/include/strings.h +++ b/include/strings.h @@ -210,34 +210,34 @@ public: // @cmember Controlla se due stringhe sono uguali bool operator ==(const char* s) const - { return strcmp(_str, s) == 0; } + { return s ? strcmp(_str, s) == 0 : empty();} // @cmember Controlla se due stringhe sono uguali bool operator ==(char* s) const - { return strcmp(_str, s) == 0; } + { return s ? strcmp(_str, s) == 0 : empty();} // @cmember Controlla se due stringe sono uguali bool operator ==(const TString& s) const { return strcmp(_str, s._str) == 0; } // @cmember Controlla se due stringhe sono diverse bool operator !=(const char* s) const - { return strcmp(_str, s) != 0; } + { return s ? strcmp(_str, s) != 0 : not_empty();} // @cmember Controlla se due stringhe sono diverse bool operator !=(char* s) const - { return strcmp(_str, s) != 0; } + { return s ? strcmp(_str, s) != 0 : not_empty();} // @cmember Controlla se due stringhe sono diverse bool operator !=(const TString& s) const { return strcmp(_str, s._str) != 0; } // @cmember Controlla se una stringa e' minore di un'altra bool operator <(const char* s) const - { return strcmp(_str, s) < 0; } + { return s ? strcmp(_str, s) < 0 : FALSE;} // @cmember Controlla se una stringa e' maggiore di un'altra bool operator >(const char* s) const - { return strcmp(_str, s) > 0; } + { return s ? strcmp(_str, s) > 0 : not_empty();} // @cmember Controlla se una stringa e' maggiore o uguale ad un'altra bool operator >=(const char* s) const - { return strcmp(_str, s) >= 0; } + { return s ? strcmp(_str, s) >= 0 : TRUE;} // @cmember Controlla se una stringa e' minore o uguale ad un'altra bool operator <=(const char* s) const - { return strcmp(_str, s) <= 0; } + { return s ? strcmp(_str, s) <= 0 : empty();} // @cmember Controlla se una stringa e' minore di un'altra bool operator <(const TString & s) const { return strcmp(_str, s._str) < 0; }