diff --git a/regenc.c b/regenc.c index fc131d2533..eb523e1ae5 100644 --- a/regenc.c +++ b/regenc.c @@ -57,7 +57,7 @@ onigenc_mbclen(const OnigUChar* p,const OnigUChar* e, OnigEncoding enc) int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc, p, e); if (ONIGENC_MBCLEN_CHARFOUND_P(ret)) { ret = ONIGENC_MBCLEN_CHARFOUND_LEN(ret); - if (ret > (int)(e - p)) ret = (int)(e - p); // just for case + if (p + ret > e) ret = (int)(e - p); // just for case return ret; } else if (ONIGENC_MBCLEN_NEEDMORE_P(ret)) { diff --git a/regexec.c b/regexec.c index 460d6e1821..6d82429e03 100644 --- a/regexec.c +++ b/regexec.c @@ -3534,7 +3534,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, n = pend - pstart; DATA_ENSURE(n); sprev = s; - STRING_CMP_IC(case_fold_flag, pstart, &s, (int)n, end); + STRING_CMP_IC(case_fold_flag, pstart, &s, n, end); while (sprev + (len = enclen_approx(encode, sprev, end)) < s) sprev += len; diff --git a/version.h b/version.h index fa5a205523..dd442f5c6b 100644 --- a/version.h +++ b/version.h @@ -11,7 +11,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 3 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 92 +#define RUBY_PATCHLEVEL 93 #include "ruby/version.h" #include "ruby/internal/abi.h"