Fixed bug in FString copy constructor

This commit is contained in:
Markus Gans 2017-03-12 01:26:08 +01:00
parent 4107227119
commit 7ab1a6b353
2 changed files with 10 additions and 9 deletions

View File

@ -6,6 +6,7 @@
* FRect can now combine two FRect objects
* The FButtonGroup got the possibility of index access
to a child button.
* Fixed bug in FString copy constructor
2017-03-08 Markus Gans <guru.mail@muenster.de>
* Improve input cursor positioning in FScrollView

View File

@ -111,15 +111,15 @@ FString::FString (uInt len, char c)
}
//----------------------------------------------------------------------
FString::FString (const FString& s) // copy constructor
: string(new wchar_t[FWDBUFFER + s.length + 1]())
, length(s.length)
, bufsize(FWDBUFFER + s.length + 1)
, c_string(0)
{
if ( s.string )
std::wcscpy (string, s.string);
}
FString::FString (const FString& s) // copy constructor
: string(0)
, length(0)
, bufsize(0)
, c_string(0)
{
if ( s.string )
_replace (s.string);
}
//----------------------------------------------------------------------
FString::FString (const std::wstring& s)