summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-30 17:21:28 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-30 17:21:28 +0000
commitec3bab8e3bf51c4a5f1cb8ab2f17c1c54f83967b (patch)
tree5d68c537b4af8fb9d770c84780f2a3ed83ca59bc /universal.c
parent7edfd0ef07bb2042adfd7871ecb385475da3f544 (diff)
downloadperl-ec3bab8e3bf51c4a5f1cb8ab2f17c1c54f83967b.tar.gz
We know the length, so use sv_setpvn rather than sv_setpv.
p4raw-id: //depot/perl@25028
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/universal.c b/universal.c
index 2b2dd451d0..ad80a21bee 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