From: <jfb...@us...> - 2009-03-13 11:39:52
|
Revision: 1007 http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1007&view=rev Author: jfbastien Date: 2009-03-13 11:39:47 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Bug 2665120: flex_string fatal error assigning big string to small Modified Paths: -------------- trunk/include/loki/flex/smallstringopt.h Modified: trunk/include/loki/flex/smallstringopt.h =================================================================== --- trunk/include/loki/flex/smallstringopt.h 2009-03-12 12:28:58 UTC (rev 1006) +++ trunk/include/loki/flex/smallstringopt.h 2009-03-13 11:39:47 UTC (rev 1007) @@ -220,15 +220,7 @@ new(this) SmallStringOpt(rhs); } else { SmallStringOpt copy(rhs); - if (Small()) { - // no need to swap, just destructively read copy into this - // ugly but efficient again - memcpy(this, ©, sizeof(*this)); - copy.buf_[maxSmallString] = maxSmallString; // clear the copy - } else { - // Use the swap trick - copy.swap(*this); - } + copy.swap(*this); } } return *this; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |