Dan Sugalski wrote:
>> From strings.pod I gather that the op 'pin' is meant to >> make strings fit for passing strings to external libraries.
> Sort of. The point is to make the string not move. Generally for > external libraries, but not universally. > > It shouldn't add the trailing null, because that would be modifying the > buffer. If you want to make sure there's a null on the end of the > string, then the best thing to do is put one there yourself. (Which, > since it's your data, would be a safe thing to do)
Yes, I have no problem with pushing a '\0' before pinning a string, that I want to pass to an external library.
The real problem is that pinning is useless, because the NCI copies the string buffer to new location and then passes the new location to the external library.
Would things break when the NCI would generally just pass the string buffer to the external library?
Not copying the string buffer would propably prevent memory checker like 'efence' from doing their work. The external libs could also modify the string, which is good and bad.
CU, Bernhard
-- ************************************************** Dipl.-Physiker Bernhard Schmalhofer Senior Developer Biomax Informatics AG Lochhamer Str. 11 82152 Martinsried, Germany Tel: +49 89 895574-839 Fax: +49 89 895574-825 eMail: [EMAIL PROTECTED] Website: www.biomax.com **************************************************