From: Christian G. <phi...@us...> - 2003-03-15 20:55:35
|
Update of /cvsroot/perl-xml/XML-LibXML-Common In directory sc8-pr-cvs1:/tmp/cvs-serv25554 Modified Files: Common.xs Log Message: Modified Files: Common.xs + use the correct copy function while docing strings. Index: Common.xs =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-Common/Common.xs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Common.xs 27 Feb 2003 18:32:59 -0000 1.5 +++ Common.xs 15 Mar 2003 20:55:32 -0000 1.6 @@ -165,6 +165,7 @@ /* copy the string */ /* warn( "simply copy the string" ); */ tstr = xmlStrdup( realstring ); + len = xmlStrlen( tstr ); } else { LibXML_COMMON_error = NEWSV(0, 512); @@ -191,8 +192,8 @@ out = xmlBufferCreate(); xmlBufferCCat( in, realstring ); if ( xmlCharEncOutFunc( coder, out, in ) >= 0 ) { - len = xmlBufferLength(out); - tstr = (xmlChar*)xmlBufferContent(out); + len = xmlBufferLength( out ); + tstr = xmlCharStrndup( xmlBufferContent( out ), len ); } xmlBufferFree( in ); @@ -208,7 +209,6 @@ } } - /* len = xmlStrlen( tstr ); */ RETVAL = newSVpvn( (const char *)tstr, len ); #ifdef HAVE_UTF8 if ( enc == XML_CHAR_ENCODING_UTF8 ) { |