Propagate const/mutable/not into the SvPV call for retrieving an
[p5sagit/p5-mst-13.2.git] / xsutils.c
index 7cdf41a..b22a263 100644 (file)
--- a/xsutils.c
+++ b/xsutils.c
@@ -61,7 +61,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs)
 
     for (nret = 0 ; numattrs && (attr = *attrlist++); numattrs--) {
        STRLEN len;
-       const char *name = SvPV(attr, len);
+       const char *name = SvPV_const(attr, len);
        const bool negated = (*name == '-');
 
        if (negated) {
@@ -258,7 +258,7 @@ usage:
     sv = SvRV(rv);
 
     if (SvOBJECT(sv))
-       sv_setpv(TARG, HvNAME_get(SvSTASH(sv)));
+       sv_setpvn(TARG, HvNAME_get(SvSTASH(sv)), HvNAMELEN_get(SvSTASH(sv)));
 #if 0  /* this was probably a bad idea */
     else if (SvPADMY(sv))
        sv_setsv(TARG, &PL_sv_no);      /* unblessed lexical */
@@ -284,7 +284,7 @@ usage:
            break;
        }
        if (stash)
-           sv_setpv(TARG, HvNAME_get(stash));
+           sv_setpvn(TARG, HvNAME_get(stash), HvNAMELEN_get(stash));
     }
 
     SvSETMAGIC(TARG);