summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2005-11-09 11:12:00 +0900
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-11-15 16:33:02 +0000
commit1a787b952b2a283c0366c148171c3bc150e9489a (patch)
tree3aef4f7a19bd6d10921dd1f1ffcfa26c741ee712 /doop.c
parentebbebb7cd2983347317369853c473fd475e0d91e (diff)
downloadperl-1a787b952b2a283c0366c148171c3bc150e9489a.tar.gz
Re: [perl #37616] Bug in &= (string) and/or m//
Message-Id: <20051109021035.69D8.BQW10602@nifty.com> p4raw-id: //depot/perl@26136
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/doop.c b/doop.c
index 8733816890..c23093caf0 100644
--- a/doop.c
+++ b/doop.c
@@ -1174,7 +1174,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
}
else if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
dc = SvPV_force_nomg_nolen(sv);
- if (SvCUR(sv) < (STRLEN)len) {
+ if (SvLEN(sv) < (STRLEN)(len + 1)) {
dc = SvGROW(sv, (STRLEN)(len + 1));
(void)memzero(dc + SvCUR(sv), len - SvCUR(sv) + 1);
}
@@ -1303,6 +1303,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
case OP_BIT_AND:
while (len--)
*dc++ = *lc++ & *rc++;
+ *dc = '\0';
break;
case OP_BIT_XOR:
while (len--)