diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-30 17:41:03 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-30 17:41:03 +0000 |
commit | a4d60858fc3c717ec83cbdceb029a69fc535e3f8 (patch) | |
tree | 8728b27b430baad907f1d019eca867d6e1495760 /util.c | |
parent | 1946a0741a168241d8fbd229705465c825727649 (diff) | |
download | perl-a4d60858fc3c717ec83cbdceb029a69fc535e3f8.tar.gz |
By grabbing the length, we can use sv_setpvn here.
p4raw-id: //depot/perl@25031
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 { |