]> granicus.if.org Git - onig/commitdiff
unicode: use OnigCtype in onigenc_unicode_ctype_code_range argument
authorRuslan Kuprieiev <kupruser@gmail.com>
Thu, 15 Jun 2017 23:34:22 +0000 (02:34 +0300)
committerRuslan Kuprieiev <kupruser@gmail.com>
Sat, 24 Jun 2017 01:51:47 +0000 (04:51 +0300)
Array index 'ctype' is of type 'int' and is not checked for
being < 0.

Id: 23, 21

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
src/regenc.h
src/unicode.c

index e119dab5a6f03a7b72205ce2dfa4c5409c3b214a..64209fc08edcf210c3336634ae8d9ebba182fd39 100644 (file)
@@ -154,7 +154,7 @@ ONIG_EXTERN struct PropertyNameCtype* sjis_lookup_property_name P_((register con
 /* in enc/unicode.c */
 ONIG_EXTERN int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));
 ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_((OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint* ranges[]));
-ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((int ctype, const OnigCodePoint* ranges[]));
+ONIG_EXTERN int onigenc_unicode_ctype_code_range P_((OnigCtype ctype, const OnigCodePoint* ranges[]));
 ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_((OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]));
 ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** pp, const UChar* end, UChar* fold));
 ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
index 8812ca2fd0f308633973e3ad9592a50056707a41..654b2b0e5cb507051660ee15d5f55ad109ecd1ae 100644 (file)
@@ -162,7 +162,7 @@ onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype)
 
 
 extern int
-onigenc_unicode_ctype_code_range(int ctype, const OnigCodePoint* ranges[])
+onigenc_unicode_ctype_code_range(OnigCtype ctype, const OnigCodePoint* ranges[])
 {
   if (ctype >= CODE_RANGES_NUM) {
     int index = ctype - CODE_RANGES_NUM;