diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
commit | 315054f4737a39489e0a14f3a92bff61f1592832 (patch) | |
tree | 62bf010653374ce09b6beb4dfa0414a91457233b /usr.bin/which | |
parent | 79e3d817585ca08a91e30ad14abe43e2ab70295f (diff) |
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.bin/which')
-rw-r--r-- | usr.bin/which/which.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c index 419b32fe35c..1f2bb65fe0b 100644 --- a/usr.bin/which/which.c +++ b/usr.bin/which/which.c @@ -1,4 +1,4 @@ -/* $OpenBSD: which.c,v 1.19 2014/05/20 01:25:23 guenther Exp $ */ +/* $OpenBSD: which.c,v 1.20 2015/01/16 06:40:14 deraadt Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> #include <sys/stat.h> #include <sys/sysctl.h> @@ -28,6 +27,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <limits.h> #define PROG_WHICH 1 #define PROG_WHEREIS 2 @@ -94,7 +94,7 @@ main(int argc, char *argv[]) int findprog(char *prog, char *path, int progmode, int allmatches) { - char *p, filename[MAXPATHLEN]; + char *p, filename[PATH_MAX]; int proglen, plen, rval = 0; struct stat sbuf; char *pathcpy; |