summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-05 20:13:34 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-05 20:13:34 +0000
commita9917092f55cf6287a909590dc9356b9393a59e0 (patch)
tree482c9ae717516b1e52157f0c6b7a554e87a796c0 /utf8.c
parent9dc04555a4dee089737beb20cff84a725f3a5696 (diff)
downloadperl-a9917092f55cf6287a909590dc9356b9393a59e0.tar.gz
Split off the UTF-8 decoder tests, make them to check also
the error message. p4raw-id: //depot/perl@7996
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/utf8.c b/utf8.c
index 5e018260fa..bc0a52178d 100644
--- a/utf8.c
+++ b/utf8.c
@@ -309,13 +309,6 @@ Perl_utf8_to_uv(pTHX_ U8* s, STRLEN curlen, STRLEN* retlen, U32 flags)
"Malformed UTF-8 character (byte order mark 0x%04"UVxf")",
uv);
goto malformed;
- } else if ((uv == 0xffff) &&
- !(flags & UTF8_ALLOW_FFFF)) {
- if (dowarn)
- Perl_warner(aTHX_ WARN_UTF8,
- "Malformed UTF-8 character (character 0x%04"UVxf")",
- uv);
- goto malformed;
} else if ((expectlen > UNISKIP(uv)) &&
!(flags & UTF8_ALLOW_LONG)) {
if (dowarn)
@@ -323,6 +316,13 @@ Perl_utf8_to_uv(pTHX_ U8* s, STRLEN curlen, STRLEN* retlen, U32 flags)
"Malformed UTF-8 character (%d byte%s, need %d)",
expectlen, expectlen == 1 ? "": "s", UNISKIP(uv));
goto malformed;
+ } else if ((uv == 0xffff) &&
+ !(flags & UTF8_ALLOW_FFFF)) {
+ if (dowarn)
+ Perl_warner(aTHX_ WARN_UTF8,
+ "Malformed UTF-8 character (character 0x%04"UVxf")",
+ uv);
+ goto malformed;
}
return uv;