by Marco van de Voort <marcov@[EMAIL PROTECTED]
>
Jun 9, 2006 at 11:10 AM
On 2006-06-09, |||newspam|||@[EMAIL PROTECTED]
|||newspam|||@[EMAIL PROTECTED]
> wrote:
> Will do what you want in this case. And with M2 compilers this will be
> type safe so that you cannot accidentally overrun the buffer. You may
> have to set appropriate compiler pragmas to prevent the call by value
> copying the constant data before the call.
>
> If you are intending to call any C code that assumes null terminated
> strings it would be wise to make the destination buffer one character
> longer than the max number of characters in your longest possible
> string.
I'm not 100% sure, but IIRC it is better to make it two.
At least some implementations of 16-bit chars (UTF16 or precursors)
terminate using double zero, and don't calculate the bufsize correctly.