Bug in TCollection_AsciiString.cxx

Hello,

try the following code with OCCT 7.8.1:

TCollection_AsciiString UIDStr("{EE1F6ED0-3EBF-4313-9F6D-188BEF85847D}");
UIDStr.RemoveAll('{', Standard_True);
UIDStr.RemoveAll('}', Standard_True);

CString UniqueDirName = UIDStr.ToCString();

UniqueDirName holds:
"EE1F6ED0-3EBF-4313-9F6D-188BEF85847D}}"

The reason is that TCollection_AsciiString::RemoveAll does not put '\0' at the end of the string.

BTW, I would have registered a bug but looks like my account has been blocked again.

Pawel

Dmitrii Pasukhin's picture

Hello. Thank you for your report.

I unlock your account. I have no idea why it happened. I created the issue: Foundation Classes - AsciiString RemoveAll do not cat the string

In case of any issues - you are free to report in GH: Issues · Open-Cascade-SAS/OCCT

Best regards, Dmitrii