]> granicus.if.org Git - onig/commitdiff
define ONIGENC_IS_CODE_XDIGIT_ASCII()
authorK.Kosako <kosako@sofnec.co.jp>
Thu, 10 Aug 2017 02:01:00 +0000 (11:01 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Thu, 10 Aug 2017 02:01:00 +0000 (11:01 +0900)
src/regint.h
src/regparse.c

index 00cb8ca991a8b397577a9f53ea130af1902a1d97..1af09b3010111657594ea29ec96551c74993cfa7 100644 (file)
@@ -284,6 +284,8 @@ typedef unsigned int  MemStatusType;
 
 #define ONIGENC_IS_CODE_DIGIT_ASCII(enc, code) \
   ((code) < 128 && ONIGENC_IS_CODE_CTYPE(enc,code,ONIGENC_CTYPE_DIGIT))
+#define ONIGENC_IS_CODE_XDIGIT_ASCII(enc, code) \
+  ((code) < 128 && ONIGENC_IS_CODE_XDIGIT(enc,code))
 
 #define DIGITVAL(code)    ((code) - '0')
 #define ODIGITVAL(code)   DIGITVAL(code)
index cf6cdac38aaae3b3d9ef2cdf04133189efeffcf3..65d36535ce8eeb52c82babb1c89612cb2f34ab95 100644 (file)
@@ -2135,7 +2135,7 @@ scan_unsigned_hexadecimal_number(UChar** src, UChar* end, int maxlen,
   num = 0;
   while (! PEND && maxlen-- != 0) {
     PFETCH(c);
-    if (ONIGENC_IS_CODE_XDIGIT(enc, c)) {
+    if (ONIGENC_IS_CODE_XDIGIT_ASCII(enc, c)) {
       val = (unsigned int )XDIGITVAL(enc,c);
       if ((INT_MAX_LIMIT - val) / 16UL < num)
         return -1;  /* overflow */
@@ -3584,7 +3584,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
         if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
         if (!PEND) {
           c2 = PPEEK;
-          if (ONIGENC_IS_CODE_XDIGIT(enc, c2))
+          if (ONIGENC_IS_CODE_XDIGIT_ASCII(enc, c2))
             return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
         }
 
@@ -3969,7 +3969,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
         num = scan_unsigned_hexadecimal_number(&p, end, 8, enc);
         if (num < 0) return ONIGERR_TOO_BIG_WIDE_CHAR_VALUE;
         if (!PEND) {
-          if (ONIGENC_IS_CODE_XDIGIT(enc, PPEEK))
+          if (ONIGENC_IS_CODE_XDIGIT_ASCII(enc, PPEEK))
             return ONIGERR_TOO_LONG_WIDE_CHAR_VALUE;
         }