diff options
-rw-r--r-- | usual/regex.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/usual/regex.c b/usual/regex.c index 28fbca7..a500fbb 100644 --- a/usual/regex.c +++ b/usual/regex.c @@ -315,11 +315,7 @@ static int op_count_full(struct ParseCtx *ctx, const char **re) } /* bad fmt, decide between error codes */ - for (a = 0; end[a] && a < 5; a++) { - if (end[a] == '}') - return REG_BADBR; - } - return REG_EBRACE; + return strchr(end, '}') ? REG_BADBR : REG_EBRACE; done: ctx->last_elem->mincnt = a; |