summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2014-07-18 04:16:09 +0000
committermatthew <matthew@openbsd.org>2014-07-18 04:16:09 +0000
commit177a74275783eeaff07d9dbc04d082f1e53274cc (patch)
treedffb9a61f3239572a305c86a608d36742ae93b8b
parentrestore umask around listener socket creation (dropped in streamlocal patch (diff)
downloadwireguard-openbsd-177a74275783eeaff07d9dbc04d082f1e53274cc.tar.xz
wireguard-openbsd-177a74275783eeaff07d9dbc04d082f1e53274cc.zip
Change lsearch()'s "base" argument to require a non-const pointer to
align with POSIX and other systems. Pointed out by Elliott Hughes on tech ok deraadt
-rw-r--r--include/search.h4
-rw-r--r--lib/libc/stdlib/lsearch.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/search.h b/include/search.h
index 1917dd0d283..37f2e60bf72 100644
--- a/include/search.h
+++ b/include/search.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: search.h,v 1.9 2012/07/10 11:44:55 guenther Exp $ */
+/* $OpenBSD: search.h,v 1.10 2014/07/18 04:16:09 matthew Exp $ */
/* $NetBSD: search.h,v 1.9 1995/08/08 21:14:45 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ ENTRY *hsearch(ENTRY, ACTION);
void *lfind(const void *, const void *, size_t *, size_t,
int (*)(const void *, const void *));
-void *lsearch(const void *, const void *, size_t *, size_t,
+void *lsearch(const void *, void *, size_t *, size_t,
int (*)(const void *, const void *));
void insque(void *, void *);
void remque(void *);
diff --git a/lib/libc/stdlib/lsearch.c b/lib/libc/stdlib/lsearch.c
index a01d80e0083..8cad05f5102 100644
--- a/lib/libc/stdlib/lsearch.c
+++ b/lib/libc/stdlib/lsearch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lsearch.c,v 1.4 2009/10/27 23:59:59 deraadt Exp $ */
+/* $OpenBSD: lsearch.c,v 1.5 2014/07/18 04:16:09 matthew Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@ static void *linear_base(const void *, const void *, size_t *, size_t,
cmp_fn_t, int);
void *
-lsearch(const void *key, const void *base, size_t *nelp, size_t width,
+lsearch(const void *key, void *base, size_t *nelp, size_t width,
cmp_fn_t compar)
{