Fix SF#2564192

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11110 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Robert Stone 2009-02-05 15:47:42 +00:00
commit 6574067b72
3 changed files with 12 additions and 1 deletions

View file

@ -6,6 +6,11 @@
SWIGINTERN int
SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
{
if (SvMAGICAL(obj)) {
SV *tmp = sv_newmortal();
SvSetSV(tmp, obj);
obj = tmp;
}
if (SvPOK(obj)) {
STRLEN len = 0;
char *cstr = SvPV(obj, len);