#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)
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 */
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;
}
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;
}