Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/MFC Support    [ Add a report in this area ]  
Report #:  5481   Status: Closed
CString::Insert appends extra wrong characters
Project:  C++Builder Build #:  10.157
Version:    6.0 Submitted By:   Oleg Fedtchenko
Report Type:  Minor failure / Design problem Date Reported:  8/4/2003 11:06:47 PM
Severity:    Serious / Highly visible problem Last Updated: 9/21/2006 7:46:56 AM
Platform:    All versions Internal Tracking #:  
Resolution: Third Party (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (3 Total Ratings)
2.00 out of 5
Total Votes: None
Description
CString::Insert appends extra wrong characters or replaces the right ones with the wrong characters
Steps to Reproduce:
       // appending wrong characters
    CString cstr = "abcd";
    cstr.Insert(0,'-');
    char pch[128];
    wsprintf(pch, "%s", (const char*)cstr);

       // replacing with wrong characters
    CString cstr = "abcdefghijklmnoprstuvxyz";
    cstr.Insert(5,'-');
    char pch[128];
    wsprintf(pch, "%s", (const char*)cstr);
Workarounds
None
Attachment
None
Comments

Andrew Cope at 8/5/2003 7:04:39 AM -
CString is a Microsoft MFC type so I doubt if Borland will be able to fix it. You are probably reliant on a fix in the next version of MFC provided with Builder.

Server Response from: ETNACODE01