Commit graph

6 commits

Author SHA1 Message Date
Vadim Zeitlin
88a0e228a9 Change the length of strings created from fixed-size buffers.
Use the usual C rule for NUL-terminated strings instead of discarding all the
trailing NUL characters.

This was unexpected (as buffers in C code are not necessarily always padded
with NULs to their full length) and also inconsistent among languages as this
was only done for those of them using typemaps/strings.swg but not for C# or
Java, for example, which terminated the string at the first NUL even before
this change.

Notice that this patch couldn't use strlen() or wcslen() with possibly not
NUL-terminated strings, so we had to add [our own equivalents of] strnlen()
and wcsnlen() and use them instead. This required adding yet another parameter
to string typemap macros, so update the example using them accordingly too.
2013-12-23 21:12:17 +00:00
William S Fulton
92ffedceb5 Perl examples makefiles clean target fixed and use RUNPIPE and tidyup 2013-04-19 22:47:26 +01:00
Marcelo Matus
9b98829ffe move xmlstring.i to a more standard location
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8228 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-06 00:06:27 +00:00
Marcelo Matus
c0e78562a4 add missing typecheck codes and Char typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8216 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-04 21:46:27 +00:00
Marcelo Matus
4c7f4ea9f7 add runme.pl file and missing %init
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8215 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-04 20:40:47 +00:00
Marcelo Matus
47a201bf89 treat XMLCh properly using %typemaps_string
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8213 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-04 20:20:33 +00:00