From: Pierre Mallard <mallard.pierre@gm...> - 2009-10-21 17:22:33
If I define in C a char[X] and set it to be X characters (without the
\0 at the end) in the script language (Perl for instance), SWIG will
fill the char buffer without the null terminating character and
without any error.
It is a bit strange to me, because if I look at the generated code
(SWIG_AsCharArray), it always return a null terminating string if
there is enough space in buffer but let a non null terminating string
in the special case where no space is left.
I would have prefer that it returns an error if no space is left
rather than returning a non null terminated character.
How could I emulate such a behaviour ?
SWIG Version 1.3.31