summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/regex/regcomp.c4
-rw-r--r--lib/libc/regex/regex2.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index c41970223f1..cf6acbb7d86 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regcomp.c,v 1.42 2021/01/02 20:42:01 millert Exp $ */
+/* $OpenBSD: regcomp.c,v 1.43 2021/01/03 17:07:57 tb Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
* Copyright (c) 1992, 1993, 1994
@@ -1099,7 +1099,7 @@ freezeset(struct parse *p, cset *cs)
if (cs2->hash == h && cs2 != cs) {
/* maybe */
for (i = 0; i < css; i++)
- if (!!CHIN(cs2, i) != !!CHIN(cs, i))
+ if (CHIN(cs2, i) != CHIN(cs, i))
break; /* no */
if (i == css)
break; /* yes */
diff --git a/lib/libc/regex/regex2.h b/lib/libc/regex/regex2.h
index 5a609f4aea8..6fb9dcca27c 100644
--- a/lib/libc/regex/regex2.h
+++ b/lib/libc/regex/regex2.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: regex2.h,v 1.11 2021/01/03 10:50:02 tb Exp $ */
+/* $OpenBSD: regex2.h,v 1.12 2021/01/03 17:07:58 tb Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
@@ -122,10 +122,10 @@ CHsub(cset *cs, char c)
cs->hash -= c;
}
-static inline uch
+static inline int
CHIN(const cset *cs, char c)
{
- return cs->ptr[(uch)c] & cs->mask;
+ return (cs->ptr[(uch)c] & cs->mask) != 0;
}
/*