AnsiString constructor works incorrectly

 

The AnsiString constructor

__fastcall AnsiString(const char* src, unsigned char len);

works incorrectly if length of the scr string is less len. Length of new AnsiString is always equal to len.

For solving this problem can be used the following construction:

AnsiString AString = AnsiString (scr, len);
AString.SetLength (strlen (AString.c_str ()));

Nikolay Antonov & Vyatcheslav Baranov. MBLab, 9/13/2001.

 
Home  -   Company  -   Sources  -   Products  -   Download  -   Order  -   Support  -   Forums  -   Contact
Copyright © 2001-2004 MBLabSoft. All Rights Reserved.