fix #1188207 and uniform the error/null/none handling

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7225 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-05-26 20:43:33 +00:00
commit a2f5af9ddd
5 changed files with 11 additions and 17 deletions

View file

@ -138,7 +138,8 @@ SWIGINTERNINLINE PyObject *
SWIG_FromCharArray(const char* carray, size_t size)
{
if (size > INT_MAX) {
return Py_None;
return SWIG_NewPointerObj(SWIG_const_cast(carray,char *),
SWIG_TypeQuery("char *"), 0);
} else {
return PyString_FromStringAndSize(carray, SWIG_numeric_cast(size,int));
}