From: Nicholas Clark Date: Thu, 30 Jun 2005 17:21:28 +0000 (+0000) Subject: We know the length, so use sv_setpvn rather than sv_setpv. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec3bab8e3bf51c4a5f1cb8ab2f17c1c54f83967b;p=p5sagit%2Fp5-mst-13.2.git We know the length, so use sv_setpvn rather than sv_setpv. p4raw-id: //depot/perl@25028 --- diff --git a/universal.c b/universal.c index 2b2dd45..ad80a21 100644 --- a/universal.c +++ b/universal.c @@ -907,10 +907,12 @@ XS(XS_PerlIO_get_layers) flgok = flgsvp && *flgsvp && SvIOK(*flgsvp); if (details) { - XPUSHs(namok ? - newSVpv(SvPVX_const(*namsvp), 0) : &PL_sv_undef); - XPUSHs(argok ? - newSVpv(SvPVX_const(*argsvp), 0) : &PL_sv_undef); + XPUSHs(namok + ? newSVpvn(SvPVX_const(*namsvp), SvCUR(*namsvp)) + : &PL_sv_undef); + XPUSHs(argok + ? newSVpvn(SvPVX_const(*argsvp), SvCUR(*argsvp)) + : &PL_sv_undef); if (flgok) XPUSHi(SvIVX(*flgsvp)); else