]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/stat.cpp
Check for self-assignment in non-trivial assignment operators
[libs/core.git] / source / fs / stat.cpp
index 773cdefbf8743ce08b6815d6a5115030944b46d1..e296ead3816b9317ecd44f0bc82bf6fbd12cbbed 100644 (file)
@@ -19,6 +19,9 @@ Stat::Stat(const Stat &other):
 
 Stat &Stat::operator=(const Stat &other)
 {
+       if(&other==this)
+               return *this;
+
        exists = other.exists;
        type = other.type;
        size = other.size;