summaryrefslogtreecommitdiffstats
path: root/bin/csh/exec.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /bin/csh/exec.c
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
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.c10
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;
}