SADAHIRO Tomoyuki <bqw10602@nifty.com> writes: > >IIRC, SvCUR() returns length w/o \0 and SvGROW() needs +1 for \0. >(sorry I did not rebuilt Encode, please test it) > >--- Unicode.xs~ Tue Sep 02 22:39:28 2003 >+++ Unicode.xs Wed Oct 08 00:34:06 2003 >@@ -54,7 +54,7 @@ > void > enc_pack(pTHX_ SV *result,STRLEN size,U8 endian,UV value) > { >- U8 *d = (U8 *)SvGROW(result,SvCUR(result)+size); >+ U8 *d = (U8 *)SvGROW(result,SvCUR(result)+size+1); > switch(endian) { > case 'v': > case 'V': I could make a case that if someone calls SvPV_nolen(sv) then they want the NUL termination so we could expand that as : SvGROW(sv,SvCUR(sv)+1) The SvGROW thing is what tend to use, but saddly it doesn't do PV-ization. > >Regards, >SADAHIRO TomoyukiThread Previous | Thread Next