aboutsummaryrefslogtreecommitdiffstats
path: root/regenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'regenc.c')
-rw-r--r--regenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/regenc.c b/regenc.c
index 32d24e76d9..70b56ef727 100644
--- a/regenc.c
+++ b/regenc.c
@@ -732,8 +732,9 @@ onigenc_mbn_is_mbc_ambiguous(OnigEncoding enc, OnigCaseFoldType flag,
extern int
onigenc_mb2_code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
{
- if ((code & 0xff00) != 0) return 2;
- else return 1;
+ if (code <= 0xff) return 1;
+ if (code <= 0xffff) return 2;
+ return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
}
extern int