more fixes/tests for empty strings

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9083 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-05-04 04:45:41 +00:00
commit 20339de8b4
6 changed files with 80 additions and 3 deletions

View file

@ -43,8 +43,8 @@ SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
SV *obj = sv_newmortal();
if (size && carray) {
if (carray[size - 1] == 0) {
if (carray) {
if (size && (carray[size - 1] == 0)) {
sv_setpv(obj, carray);
} else {
char *tmp = %new_array(size + 1, char);