summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-30 17:41:03 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-30 17:41:03 +0000
commita4d60858fc3c717ec83cbdceb029a69fc535e3f8 (patch)
tree8728b27b430baad907f1d019eca867d6e1495760 /util.c
parent1946a0741a168241d8fbd229705465c825727649 (diff)
downloadperl-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index fb7108f56e..4da13d4522 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 {