summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/misc/regex/regex_old.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 65aec97f1..e2824eda5 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -6099,7 +6099,7 @@ byte_re_match_2_internal (
{ /* No. So allocate them with malloc. We need one
extra element beyond `num_regs' for the `-1' marker
GNU code uses. */
- regs->num_regs = MAX (RE_NREGS, num_regs + 1);
+ regs->num_regs = MIN (RE_NREGS, num_regs + 1);
regs->start = TALLOC (regs->num_regs, regoff_t);
regs->end = TALLOC (regs->num_regs, regoff_t);
if (regs->start == NULL || regs->end == NULL)