solve possible seg. faults and directors #1080075

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6894 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-12-16 10:40:01 +00:00
commit e67b13b202
7 changed files with 28 additions and 24 deletions

View file

@ -98,7 +98,7 @@
%typemap(directorout,fragment=#SWIG_AsCharPtr)
Char *, Char const*, Char *const, Char const* const
"if (!SWIG_AsCharPtr($input, (Char**) &$result)) {
"if (!$input || !SWIG_AsCharPtr($input, (Char**) &$result)) {
Swig::DirectorTypeMismatchException(\"Error converting Python object into Char*\");
}";
@ -106,7 +106,7 @@
Char const *&, Char *const &, Char const *const &
{
Char* temp;
if (!SWIG_AsCharPtr($input, &temp)) {
if (!$input || !SWIG_AsCharPtr($input, &temp)) {
Swig::DirectorTypeMismatchException("Error converting Python object into Char*");
}
$result = ($1_ltype) &temp;
@ -239,7 +239,7 @@
%typemap(directorout,fragment=#SWIG_AsCharArray)
Char [ANY], const Char [ANY] (Char temp[$result_dim0])
{
if (!SWIG_AsCharArray($input, temp, $result_dim0)) {
if (!$input || !SWIG_AsCharArray($input, temp, $result_dim0)) {
Swig::DirectorTypeMismatchException("Error converting Python object into Char[$result_dim0]");
}
$result = temp;