diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c index b7a7c91..e363a28 100644 --- a/usr.bin/grep/regex/tre-fastmatch.c +++ b/usr.bin/grep/regex/tre-fastmatch.c @@ -101,9 +101,9 @@ static int fastcmp(const fastmatch_t *fg, const void *data, #define IS_OUT_OF_BOUNDS \ ((!fg->reversed \ - ? ((type == STR_WIDE) ? ((j + fg->wlen) > len) \ - : ((j + fg->len) > len)) \ - : (j < 0))) + ? ((type == STR_WIDE) ? ((j + fg->wlen) >= len) \ + : ((j + fg->len) >= len)) \ + : (j <= 0))) /* * Checks whether the new position after shifting in the input string