summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2002-06-05 19:27:50 +0000
committerespie <espie@openbsd.org>2002-06-05 19:27:50 +0000
commitb73de0454a28dc806ea202ae91e734eb6015ee0f (patch)
treea14c5bddb1e522136de82c85a5ff6a318f58ce2d
parentprovide our own path for generating the ldscripts and tweak it accordingly; fgsch@ ok (diff)
downloadwireguard-openbsd-b73de0454a28dc806ea202ae91e734eb6015ee0f.tar.xz
wireguard-openbsd-b73de0454a28dc806ea202ae91e734eb6015ee0f.zip
Use attribute((sentinel)) on functions where it makes sense.
(this will warn if they are used without a terminating NULL pointer. Note *pointer*, very useful for arches where 0 != (void *)0, in size) okay millert@
-rw-r--r--include/bsd_auth.h9
-rw-r--r--include/unistd.h11
2 files changed, 13 insertions, 7 deletions
diff --git a/include/bsd_auth.h b/include/bsd_auth.h
index 964e9c586b8..1b775a215bf 100644
--- a/include/bsd_auth.h
+++ b/include/bsd_auth.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bsd_auth.h,v 1.5 2002/03/12 02:28:11 millert Exp $ */
+/* $OpenBSD: bsd_auth.h,v 1.6 2002/06/05 19:27:50 espie Exp $ */
/*-
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -58,7 +58,9 @@ char *auth_getitem(auth_session_t *, auth_item_t);
int auth_setitem(auth_session_t *, auth_item_t, char *);
auth_session_t *auth_open(void);
-auth_session_t *auth_verify(auth_session_t *, char *, char *, ...);
+auth_session_t *auth_verify(auth_session_t *, char *, char *, ...)
+ __attribute__((sentinel));
+
auth_session_t *auth_userchallenge(char *, char *, char *, char **);
auth_session_t *auth_usercheck(char *, char *, char *, char *);
@@ -76,7 +78,8 @@ void auth_setenv(auth_session_t *);
void auth_clrenv(auth_session_t *);
void auth_setstate(auth_session_t *, int);
-int auth_call(auth_session_t *, char *, ...);
+int auth_call(auth_session_t *, char *, ...)
+ __attribute__((sentinel));
int auth_setdata(auth_session_t *, void *, size_t);
int auth_setoption(auth_session_t *, char *, char *);
diff --git a/include/unistd.h b/include/unistd.h
index 394b5221ca5..0611959601d 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.37 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: unistd.h,v 1.38 2002/06/05 19:27:50 espie Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -66,9 +66,12 @@ size_t confstr(int, char *, size_t);
char *cuserid(char *);
int dup(int);
int dup2(int, int);
-int execl(const char *, const char *, ...);
-int execle(const char *, const char *, ...);
-int execlp(const char *, const char *, ...);
+int execl(const char *, const char *, ...)
+ __attribute__((sentinel));
+int execle(const char *, const char *, ...)
+ __attribute__((sentinel));
+int execlp(const char *, const char *, ...)
+ __attribute__((sentinel));
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);