summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorSpider Boardman <spider@orb.nashua.nh.us>2000-09-14 13:09:36 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2000-09-14 21:20:09 +0000
commit9f9ab9055319ce9b1a2b147cb13f3474dcc9c3b7 (patch)
tree5264554c9bca1d57d9abafd0939373ff9853a90a /utf8.c
parent3282e3a65f9bcf8c13ecb7e0f06da5d5fb020fef (diff)
downloadperl-9f9ab9055319ce9b1a2b147cb13f3474dcc9c3b7.tar.gz
Replace #7084 with
Subject: Re: perl@7078 Message-Id: <200009142109.RAA03425@leggy.zk3.dec.com> p4raw-id: //depot/perl@7085
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 6ae92bd0d9..d97a8b003d 100644
--- a/utf8.c
+++ b/utf8.c
@@ -299,7 +299,8 @@ Perl_utf8_to_bytes(pTHX_ U8* s, STRLEN *len)
/* ensure valid UTF8 and chars < 256 before updating string */
while (s < send) {
U8 c = *s++;
- if ( (s >= send) || (*s & 0x80 && c > 0xc3)) {
+ if (c >= 0x80 &&
+ ( (s >= send) || ((*s++ & 0xc0) != 0x80) || ((c & 0xfe) != 0xc2))) {
*len = -1;
return 0;
}