[fpc-devel] Found two Delphi incompatibilities

Daniël Mantione daniel.mantione at freepascal.org
Thu Aug 31 12:21:33 CEST 2006



Op Thu, 31 Aug 2006, schreef Sergei Gorelkin:

> What makes a difference is actually TStrings.SetTextStr implementation.
> Delphi accesses the argument as null-terminated string, so it works perfectly
> well even without conversion. FPC implementation treats argument as
> AnsiString, accesses its Length field and eventually segfaults...

I think FPC's implementation is correct, because, as I read the 
documentation, it isn't specified that the string cannot contain #0.
So, you need to use the actual length of the string.

Daniël


More information about the fpc-devel mailing list