Perl_do_vop can profitably use Perl_sv_usepvn_flags, as it has
Nicholas Clark [Sun, 16 Apr 2006 13:25:18 +0000 (13:25 +0000)]
allocated space for an initialised a trailing NUL.

p4raw-id: //depot/perl@27843

doop.c

diff --git a/doop.c b/doop.c
index cfc67cb..5972dbd 100644 (file)
--- a/doop.c
+++ b/doop.c
@@ -1214,7 +1214,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
        needlen = ((optype == OP_BIT_AND)
                    ? len : (leftlen > rightlen ? leftlen : rightlen));
        Newxz(dc, needlen + 1, char);
-       (void)sv_usepvn(sv, dc, needlen);
+       sv_usepvn_flags(sv, dc, needlen, SV_HAS_TRAILING_NUL);
        dc = SvPVX(sv);         /* sv_usepvn() calls Renew() */
     }
     SvCUR_set(sv, len);