author | zecke <zecke> | 2003-05-14 14:43:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-05-14 14:43:13 (UTC) |
commit | e79fbade975dd5e0bf5d8fc649b755c11c7956c4 (patch) (side-by-side diff) | |
tree | 992283b77d27625485b52a653bff9dbaa0707c79 | |
parent | cc794c5ba028bbf07fa280ed49bd0b8cfb745bd7 (diff) | |
download | opie-e79fbade975dd5e0bf5d8fc649b755c11c7956c4.zip opie-e79fbade975dd5e0bf5d8fc649b755c11c7956c4.tar.gz opie-e79fbade975dd5e0bf5d8fc649b755c11c7956c4.tar.bz2 |
Guard against self assignment
-rw-r--r-- | libopie/pim/opimrecord.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp index 9510357..0c9734d 100644 --- a/libopie/pim/opimrecord.cpp +++ b/libopie/pim/opimrecord.cpp @@ -22,8 +22,10 @@ OPimRecord::OPimRecord( const OPimRecord& rec ) (*this) = rec; } OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { + if ( this == &rec ) return *this; + Qtopia::Record::operator=( rec ); m_xrefman = rec.m_xrefman; m_lastHit = rec.m_lastHit; diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index 9510357..0c9734d 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp @@ -22,8 +22,10 @@ OPimRecord::OPimRecord( const OPimRecord& rec ) (*this) = rec; } OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { + if ( this == &rec ) return *this; + Qtopia::Record::operator=( rec ); m_xrefman = rec.m_xrefman; m_lastHit = rec.m_lastHit; |