diff options
Diffstat (limited to 'enc/euc_tw.c')
-rw-r--r-- | enc/euc_tw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/enc/euc_tw.c b/enc/euc_tw.c index ca38983d53..d025a0dd45 100644 --- a/enc/euc_tw.c +++ b/enc/euc_tw.c @@ -187,7 +187,7 @@ euctw_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc) #define euctw_islead(c) ((UChar )((c) - 0xa1) > 0xfe - 0xa1) static UChar* -euctw_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc) +euctw_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end, OnigEncoding enc) { /* Assumed in this encoding, mb-trail bytes don't mix with single bytes. @@ -199,7 +199,7 @@ euctw_left_adjust_char_head(const UChar* start, const UChar* s, OnigEncoding enc p = s; while (!euctw_islead(*p) && p > start) p--; - len = enclen(enc, p, s); + len = enclen(enc, p, end); if (p + len > s) return (UChar* )p; p += len; return (UChar* )(p + ((s - p) & ~1)); |