aboutsummaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-18 11:28:39 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-18 11:28:39 -0800
commit0b0e99bfac8e11463ae15211882aab98ba150dcb (patch)
treebbcce8c175438e8f6152207c9cd9099942230b2f /match.c
parente98574570ec0e355c6cff2b6e30bd992f20fe610 (diff)
A few more pedantic cleanups
Diffstat (limited to 'match.c')
-rw-r--r--match.c5
1 files changed, 2 insertions, 3 deletions
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;
}
//