From 6ab22ad6a90b96f159a0d78499a49fd62989cb15 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 23 Sep 2021 17:50:16 -0700 Subject: Bugfix --- match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/match.c b/match.c index f8205d4..ac8543e 100644 --- a/match.c +++ b/match.c @@ -270,7 +270,7 @@ static match_t *_next_match(def_t *defs, cache_t *cache, file_t *f, const char * else if (upper) str = upper; else if (lower) str = lower; } else { - char *found = memmem(str, (size_t)(str - f->end), first->args.string, first->min_matchlen); + char *found = memmem(str, (size_t)(f->end - str), first->args.string, first->min_matchlen); str = found ? found : f->end; } } -- cgit v1.2.3