Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/regex simplify.



details:   https://anonhg.NetBSD.org/src/rev/4bd20c2edb19
branches:  trunk
changeset: 770535:4bd20c2edb19
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Oct 21 00:41:34 2011 +0000

description:
simplify.

diffstat:

 tests/lib/libc/regex/t_exhaust.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r fea85f31b48c -r 4bd20c2edb19 tests/lib/libc/regex/t_exhaust.c
--- a/tests/lib/libc/regex/t_exhaust.c  Thu Oct 20 22:04:10 2011 +0000
+++ b/tests/lib/libc/regex/t_exhaust.c  Fri Oct 21 00:41:34 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_exhaust.c,v 1.1 2011/10/09 18:21:08 christos Exp $   */
+/*     $NetBSD: t_exhaust.c,v 1.2 2011/10/21 00:41:34 christos Exp $   */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_exhaust.c,v 1.1 2011/10/09 18:21:08 christos Exp $");
+__RCSID("$NetBSD: t_exhaust.c,v 1.2 2011/10/21 00:41:34 christos Exp $");
 
 #include <stdio.h>
 #include <regex.h>
@@ -178,12 +178,12 @@
                char *d = (*patterns[i])(9999);
                e = regcomp(&re, d, i == 6 ? REG_BASIC : REG_EXTENDED);
                free(d);
-               if (e != 0)
+               if (e) {
                        ATF_REQUIRE_MSG(e == REG_ESPACE,
                            "regcomp returned %d for pattern %zu", e, i);
-               if (e)
                        continue;
-               e = regexec(&re, "aaaaaaaa", 0, NULL, 0);
+               }
+               (void)regexec(&re, "aaaaaaaa", 0, NULL, 0);
                regfree(&re);
        }
 }



Home | Main Index | Thread Index | Old Index