summaryrefslogtreecommitdiff
path: root/pp_pack.c
diff options
context:
space:
mode:
authorperl-5.8.0@ton.iguana.be <perl-5.8.0@ton.iguana.be>2005-02-05 18:09:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-02-08 09:31:45 +0000
commitf0df5f8b34ab27424e2b758635888ff39aa69398 (patch)
tree7dd0757341df08bda8095b4fd8723da63634422f /pp_pack.c
parent580a9fe1f2eadca33b9bfe7700739a00e7d804ca (diff)
downloadperl-f0df5f8b34ab27424e2b758635888ff39aa69398.tar.gz
[perl #34062] pack Z0 destroys the character before
From: perl-5.8.0@ton.iguana.be (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.0.11-34062-107199.19.360569328007@perl.org> (plus a regression test) p4raw-id: //depot/perl@23946
Diffstat (limited to 'pp_pack.c')
-rw-r--r--pp_pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_pack.c b/pp_pack.c
index 3ee7128511..690cd35758 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2107,7 +2107,7 @@ S_pack_rec(pTHX_ SV *cat, register tempsym_t* symptr, register SV **beglist, SV
}
if ((I32)fromlen >= len) {
sv_catpvn(cat, aptr, len);
- if (datumtype == 'Z')
+ if (datumtype == 'Z' && len > 0)
*(SvEND(cat)-1) = '\0';
}
else {