summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regexec.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2013-04-17 17:39:29 +0000
committertedu <tedu@openbsd.org>2013-04-17 17:39:29 +0000
commit2be36617bb6be3f60e44cb636fdb1fa78531d399 (patch)
tree368c866377d5c958c50b0fc4fe319d8dbdeb6f92 /lib/libc/regex/regexec.c
parentpretty (diff)
downloadwireguard-openbsd-2be36617bb6be3f60e44cb636fdb1fa78531d399.tar.xz
wireguard-openbsd-2be36617bb6be3f60e44cb636fdb1fa78531d399.zip
silence some warnings by adding prototypes, casts, and headers as
appropriate. in regex, stop using the struct hack for a fixed size array
Diffstat (limited to 'lib/libc/regex/regexec.c')
-rw-r--r--lib/libc/regex/regexec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c
index 7b3bfc7a0b1..5e986f34c3c 100644
--- a/lib/libc/regex/regexec.c
+++ b/lib/libc/regex/regexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regexec.c,v 1.11 2005/08/05 13:03:00 espie Exp $ */
+/* $OpenBSD: regexec.c,v 1.12 2013/04/17 17:39:29 tedu Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994 Henry Spencer.
* Copyright (c) 1992, 1993, 1994
@@ -140,6 +140,8 @@ regexec(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
struct re_guts *g = preg->re_g;
+ char *s = (char *)string; /* XXX fucking gcc XXX */
+
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
#else
@@ -154,7 +156,7 @@ regexec(const regex_t *preg, const char *string, size_t nmatch,
eflags = GOODFLAGS(eflags);
if (g->nstates <= CHAR_BIT*sizeof(states1) && !(eflags&REG_LARGE))
- return(smatcher(g, (char *)string, nmatch, pmatch, eflags));
+ return(smatcher(g, s, nmatch, pmatch, eflags));
else
- return(lmatcher(g, (char *)string, nmatch, pmatch, eflags));
+ return(lmatcher(g, s, nmatch, pmatch, eflags));
}