summaryrefslogtreecommitdiffstats
path: root/bin/ksh/misc.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/ksh/misc.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/ksh/misc.c')
-rw-r--r--bin/ksh/misc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/ksh/misc.c b/bin/ksh/misc.c
index 3a5f19f0930..90da37d0426 100644
--- a/bin/ksh/misc.c
+++ b/bin/ksh/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.38 2013/11/28 10:33:37 sobrado Exp $ */
+/* $OpenBSD: misc.c,v 1.39 2015/01/16 06:39:32 deraadt Exp $ */
/*
* Miscellaneous functions
@@ -6,7 +6,6 @@
#include "sh.h"
#include <ctype.h>
-#include <sys/param.h> /* for MAXPATHLEN */
#include "charclass.h"
short ctypes [UCHAR_MAX+1]; /* type bits for unsigned char */
@@ -1120,7 +1119,7 @@ reset_nonblock(int fd)
}
-/* Like getcwd(), except bsize is ignored if buf is 0 (MAXPATHLEN is used) */
+/* Like getcwd(), except bsize is ignored if buf is 0 (PATH_MAX is used) */
char *
ksh_get_wd(char *buf, int bsize)
{
@@ -1131,8 +1130,8 @@ ksh_get_wd(char *buf, int bsize)
* inject possibly allocated space into the ATEMP area. */
/* Assume getcwd() available */
if (!buf) {
- bsize = MAXPATHLEN;
- b = alloc(MAXPATHLEN + 1, ATEMP);
+ bsize = PATH_MAX;
+ b = alloc(PATH_MAX + 1, ATEMP);
} else
b = buf;