summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-04-28 09:33:26 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-04-28 09:33:26 +0000
commit3399f0414ad939f7d0381e4fc7351f342abe2de6 (patch)
tree454d8b7c8f23006b6d560c7c75a727f1353af6d3 /pp.c
parent51ee650079cd7ef6a0ae6b587f0db512c6cfacde (diff)
downloadperl-3399f0414ad939f7d0381e4fc7351f342abe2de6.tar.gz
fix for missed accounting for null byte in pack("Z",...) (from
M.J.T. Guy) p4raw-id: //depot/perl@5994
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index e90b5386fc..17824bd090 100644
--- a/pp.c
+++ b/pp.c
@@ -4438,7 +4438,8 @@ PP(pp_pack)
if ((*pat != 'a' && *pat != 'A' && *pat != 'Z') || pat[1] != '*')
DIE(aTHX_ "/ must be followed by a*, A* or Z*");
lengthcode = sv_2mortal(newSViv(sv_len(items > 0
- ? *MARK : &PL_sv_no)));
+ ? *MARK : &PL_sv_no)
+ + (*pat == 'Z' ? 1 : 0)));
}
switch(datumtype) {
default: