diff options
Diffstat (limited to 'src/include/buffer.h')
-rw-r--r-- | src/include/buffer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/buffer.h b/src/include/buffer.h index 9a635bdb5d0..4f87ed7453b 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -248,7 +248,7 @@ public: p(other.p), p_off(other.p_off) {} - iterator operator=(const iterator& other) { + iterator& operator=(const iterator& other) { if (this != &other) { bl = other.bl; ls = other.ls; @@ -305,8 +305,10 @@ public: list(const list& other) : _buffers(other._buffers), _len(other._len), last_p(this) { } list& operator= (const list& other) { - _buffers = other._buffers; - _len = other._len; + if (this != &other) { + _buffers = other._buffers; + _len = other._len; + } return *this; } |