diff --git a/ChangeLog b/ChangeLog index 4f37eb9c60..f5c8ca8712 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 14 18:18:05 2010 NARUSE, Yui + + * regexec.c (match_at): add end point to enclen's argument. + This only effect on compilinig with -DONIG_DEBUG_MATCH. + Tue Jul 13 20:46:00 2010 Nobuyoshi Nakada * ext/dl/handle.c (rb_dlhandle_close): should not pass a dynamic diff --git a/regexec.c b/regexec.c index 13b6fadee2..c78d8ea998 100644 --- a/regexec.c +++ b/regexec.c @@ -1300,13 +1300,13 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, s = (UChar* )sstart; while (1) { #ifdef ONIG_DEBUG_MATCH - { + if (s) { UChar *q, *bp, buf[50]; int len; fprintf(stderr, "%4d> \"", (int )(s - str)); bp = buf; for (i = 0, q = s; i < 7 && q < end; i++) { - len = enclen(encode, q); + len = enclen(encode, q, end); while (len-- > 0) *bp++ = *q++; } if (q < end) { xmemcpy(bp, "...\"", 4); bp += 4; }