summaryrefslogtreecommitdiff
path: root/regress/lib/libc
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2011-11-06 15:47:08 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2011-11-06 15:47:08 +0000
commitc965597c82711874e996d7478cad46bdd114620c (patch)
treecc2cd2185e30cf6ceb460e5d01956d0451bf102e /regress/lib/libc
parent1ce6a698f5b8e0a1a2922046107e28e34addeaf0 (diff)
return non-zero on error
Diffstat (limited to 'regress/lib/libc')
-rw-r--r--regress/lib/libc/regex/t_exhaust.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/regress/lib/libc/regex/t_exhaust.c b/regress/lib/libc/regex/t_exhaust.c
index 870dae64fa1..e4d4e4f5d7c 100644
--- a/regress/lib/libc/regex/t_exhaust.c
+++ b/regress/lib/libc/regex/t_exhaust.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: t_exhaust.c,v 1.1 2011/11/05 15:01:37 otto Exp $ */
+/* $OpenBSD: t_exhaust.c,v 1.2 2011/11/06 15:47:07 otto Exp $ */
/* $NetBSD: t_exhaust.c,v 1.2 2011/10/21 00:41:34 christos Exp $ */
/*-
@@ -164,7 +164,7 @@ static char *(*patterns[])(size_t) = {
main()
{
regex_t re;
- int e;
+ int e, ret = 0;
size_t i;
for (i = 0; i < sizeof(patterns) / sizeof(patterns[0]); i++) {
@@ -172,13 +172,15 @@ main()
e = regcomp(&re, d, i == 6 ? REG_BASIC : REG_EXTENDED);
free(d);
if (e) {
- if (e != REG_ESPACE)
+ if (e != REG_ESPACE) {
printf("regcomp returned %d for pattern %zu", e, i);
+ ret = 1;
+ }
continue;
}
(void)regexec(&re, "aaaaaaaa", 0, NULL, 0);
regfree(&re);
}
- return 0;
+ return ret;
}