From: Nicholas Clark Date: Thu, 30 Jun 2005 17:41:03 +0000 (+0000) Subject: By grabbing the length, we can use sv_setpvn here. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4d60858fc3c717ec83cbdceb029a69fc535e3f8;p=p5sagit%2Fp5-mst-13.2.git By grabbing the length, we can use sv_setpvn here. p4raw-id: //depot/perl@25031 --- diff --git a/util.c b/util.c index fb7108f..4da13d4 100644 --- a/util.c +++ b/util.c @@ -4032,8 +4032,9 @@ Perl_new_version(pTHX_ SV *ver) if ( SvVOK(ver) ) { /* already a v-string */ char *version; MAGIC* mg = mg_find(ver,PERL_MAGIC_vstring); - version = savepvn( (const char*)mg->mg_ptr,mg->mg_len ); - sv_setpv(rv,version); + const STRLEN len = mg->mg_len; + version = savepvn( (const char*)mg->mg_ptr, len); + sv_setpvn(rv,version,len); Safefree(version); } else {