Simplify the implementation of SvPV*nolen functions
[p5sagit/p5-mst-13.2.git] / xsutils.c
index 7cdf41a..7b968cf 100644 (file)
--- a/xsutils.c
+++ b/xsutils.c
@@ -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);