summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>1998-10-13 23:35:39 +0200
committerGurusamy Sarathy <gsar@cpan.org>1998-10-17 02:49:19 +0000
commit32d8b6e578ec44eac9ae5b98b03f265909d36357 (patch)
treec943a06d89aa18601a8a7342316ea8330d49a23c /pp.c
parent6756f2f0bba8a181bed0219554fd4fa332538853 (diff)
downloadperl-32d8b6e578ec44eac9ae5b98b03f265909d36357.tar.gz
fix buggy treatment of large checksums on unicode strings
Message-ID: <m31zocp850.fsf@furu.g.aas.no> Subject: unpack("%48U*",...) [PATCH 5.005_52] p4raw-id: //depot/perl@1997
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 998cf93da1..9d9ad5c50d 100644
--- a/pp.c
+++ b/pp.c
@@ -3416,7 +3416,10 @@ PP(pp_unpack)
while (len-- > 0 && s < strend) {
auint = utf8_to_uv((U8*)s, &along);
s += along;
- culong += auint;
+ if (checksum > 32)
+ cdouble += (double)auint;
+ else
+ culong += auint;
}
}
else {
@@ -3852,7 +3855,7 @@ PP(pp_unpack)
if (checksum) {
sv = NEWSV(42, 0);
if (strchr("fFdD", datumtype) ||
- (checksum > 32 && strchr("iIlLN", datumtype)) ) {
+ (checksum > 32 && strchr("iIlLNU", datumtype)) ) {
double trouble;
adouble = 1.0;