summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2003-05-14 14:43:13 (UTC)
committer zecke <zecke>2003-05-14 14:43:13 (UTC)
commite79fbade975dd5e0bf5d8fc649b755c11c7956c4 (patch) (unidiff)
tree992283b77d27625485b52a653bff9dbaa0707c79 /libopie
parentcc794c5ba028bbf07fa280ed49bd0b8cfb745bd7 (diff)
downloadopie-e79fbade975dd5e0bf5d8fc649b755c11c7956c4.zip
opie-e79fbade975dd5e0bf5d8fc649b755c11c7956c4.tar.gz
opie-e79fbade975dd5e0bf5d8fc649b755c11c7956c4.tar.bz2
Guard against self assignment
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimrecord.cpp2
1 files changed, 2 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
@@ -20,12 +20,14 @@ OPimRecord::OPimRecord( const OPimRecord& rec )
20 : Qtopia::Record( rec ) 20 : Qtopia::Record( rec )
21{ 21{
22 (*this) = rec; 22 (*this) = rec;
23} 23}
24 24
25OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { 25OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
26 if ( this == &rec ) return *this;
27
26 Qtopia::Record::operator=( rec ); 28 Qtopia::Record::operator=( rec );
27 m_xrefman = rec.m_xrefman; 29 m_xrefman = rec.m_xrefman;
28 m_lastHit = rec.m_lastHit; 30 m_lastHit = rec.m_lastHit;
29 31
30 return *this; 32 return *this;
31} 33}