summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-25 01:17:58 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-25 01:17:58 +0000
commitcac6ed4e68078655bf86749d86eb4330541ef4e6 (patch)
tree3a930194b3717e47b9c6f627a90a2a9b75dd896b
parent17b4c12a95d762fc786754be9d663135e5d582d7 (diff)
test/regex/tst-regex2.c: fix test failure. Next one is immediately after...
test 2 pattern 0 '.?.?.?.?.?.?.?Log\.13' -incorrect num_regs 30, expected 2 + 1.283480s +test 2 pattern 1 '(.?)(.?)(.?)(.?)(.?)(.?)(.?)Log\.13' + 3.429810s +test 2 pattern 2 '((((((((((.?))))))))))((((((((((.?))))))))))....' +incorrect num_regs 30, expected 72
-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)