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 /bin/csh/exec.c | |
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 'bin/csh/exec.c')
-rw-r--r-- | bin/csh/exec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/csh/exec.c b/bin/csh/exec.c index fb5061e93ea..ea0bf3f26b8 100644 --- a/bin/csh/exec.c +++ b/bin/csh/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.15 2009/10/27 23:59:21 deraadt Exp $ */ +/* $OpenBSD: exec.c,v 1.16 2015/01/16 06:39:31 deraadt Exp $ */ /* $NetBSD: exec.c,v 1.9 1996/09/30 20:03:54 christos Exp $ */ /*- @@ -31,7 +31,6 @@ */ #include <sys/types.h> -#include <sys/param.h> #include <dirent.h> #include <fcntl.h> #include <sys/stat.h> @@ -39,6 +38,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include <stdarg.h> #include "csh.h" @@ -554,17 +554,17 @@ static int executable(Char *dir, Char *name, bool dir_ok) { struct stat stbuf; - Char path[MAXPATHLEN], *dp, *sp; + Char path[PATH_MAX], *dp, *sp; char *strname; if (dir && *dir) { for (dp = path, sp = dir; *sp; *dp++ = *sp++) - if (dp == &path[MAXPATHLEN]) { + if (dp == &path[PATH_MAX]) { *--dp = '\0'; break; } for (sp = name; *sp; *dp++ = *sp++) - if (dp == &path[MAXPATHLEN]) { + if (dp == &path[PATH_MAX]) { *--dp = '\0'; break; } |