summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>1998-10-20 16:24:44 +0200
committerGurusamy Sarathy <gsar@cpan.org>1998-10-25 06:45:09 +0000
commitbdeef251cd01b4ea0422cf98195dbdbc42aa71fd (patch)
treef4bbb2170d3ecbb5e0a594e63d35d63483ca410b /pp.c
parent28743a51b27ece9d3ca5cbbc42381d1c1b7fb950 (diff)
downloadperl-bdeef251cd01b4ea0422cf98195dbdbc42aa71fd.tar.gz
ord() and unpack("U*",...) should not be negative
Message-ID: <m34sszctf7.fsf@furu.g.aas.no> p4raw-id: //depot/perl@2064
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pp.c b/pp.c
index 495b9ea061..72599d1e16 100644
--- a/pp.c
+++ b/pp.c
@@ -2120,15 +2120,15 @@ PP(pp_sprintf)
PP(pp_ord)
{
djSP; dTARGET;
- I32 value;
+ UV value;
U8 *tmps = (U8*)POPp;
I32 retlen;
if (IN_UTF8 && (*tmps & 0x80))
- value = (I32) utf8_to_uv(tmps, &retlen);
+ value = utf8_to_uv(tmps, &retlen);
else
- value = (I32) (*tmps & 255);
- XPUSHi(value);
+ value = (UV)(*tmps & 255);
+ XPUSHu(value);
RETURN;
}
@@ -3433,7 +3433,7 @@ PP(pp_unpack)
auint = utf8_to_uv((U8*)s, &along);
s += along;
sv = NEWSV(37, 0);
- sv_setiv(sv, (IV)auint);
+ sv_setuv(sv, (UV)auint);
PUSHs(sv_2mortal(sv));
}
}