diff options
author | Gisle Aas <gisle@aas.no> | 1998-10-13 23:35:39 +0200 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-17 02:49:19 +0000 |
commit | 32d8b6e578ec44eac9ae5b98b03f265909d36357 (patch) | |
tree | c943a06d89aa18601a8a7342316ea8330d49a23c /pp.c | |
parent | 6756f2f0bba8a181bed0219554fd4fa332538853 (diff) | |
download | perl-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |