X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0ac4ca0aa56954ca1100688ba670cef8d017c948..01d2ec474c4c1828c229830ba4e4961de5f0527d:/include/xbt/string.hpp diff --git a/include/xbt/string.hpp b/include/xbt/string.hpp index cd51303a28..5b8ab7d46d 100644 --- a/include/xbt/string.hpp +++ b/include/xbt/string.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -121,7 +121,8 @@ public: } string& operator=(string const& s) { - assign(s.c_str(), s.size()); + if (this != &s) + assign(s.c_str(), s.size()); return *this; } string& operator=(std::string const& s)