From 0b0e99bfac8e11463ae15211882aab98ba150dcb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 18 Jan 2021 11:28:39 -0800 Subject: A few more pedantic cleanups --- match.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'match.c') diff --git a/match.c b/match.c index a8451e6..eb9b383 100644 --- a/match.c +++ b/match.c @@ -271,7 +271,7 @@ static match_t *match(def_t *defs, file_t *f, const char *str, pat_t *pat, bool match_t *mp = match(defs, f, str, pat->args.repetitions.repeat_pat, ignorecase); if (mp == NULL) { str = start; - recycle_if_unused(&msep); + if (msep) recycle_if_unused(&msep); break; } if (mp->end == start && reps > 0) { @@ -281,7 +281,7 @@ static match_t *match(def_t *defs, file_t *f, const char *str, pat_t *pat, bool // the next loop either. We know that this will continue to // loop until reps==max, so let's just cut to the chase // instead of looping infinitely. - recycle_if_unused(&msep); + if (msep) recycle_if_unused(&msep); recycle_if_unused(&mp); if (pat->args.repetitions.max == -1) reps = ~(size_t)0; @@ -573,7 +573,6 @@ match_t *get_capture(match_t *m, const char **id) if (**id == ';') ++(*id); return cap; } - return NULL; } // -- cgit v1.2.3