diff options
| author | 2015-01-16 06:39:28 +0000 | |
|---|---|---|
| committer | 2015-01-16 06:39:28 +0000 | |
| commit | b9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch) | |
| tree | 72b2433e418dfa1aef5fcf8305617b97979a25d8 /bin/cp/utils.c | |
| parent | improve checksum parsing slightly. now handles filenames with spaces. (diff) | |
| download | wireguard-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/cp/utils.c')
| -rw-r--r-- | bin/cp/utils.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 1a39ae783a2..2d76aa0cde9 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.34 2014/04/24 01:34:35 tedu Exp $ */ +/* $OpenBSD: utils.c,v 1.35 2015/01/16 06:39:31 deraadt Exp $ */ /* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */ /*- @@ -30,7 +30,7 @@ * SUCH DAMAGE. */ -#include <sys/param.h> +#include <sys/param.h> /* for MAXBSIZE */ #include <sys/stat.h> #include <sys/mman.h> #include <sys/time.h> @@ -43,6 +43,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <limits.h> #include "extern.h" @@ -201,7 +202,7 @@ int copy_link(FTSENT *p, int exists) { int len; - char link[MAXPATHLEN]; + char link[PATH_MAX]; if ((len = readlink(p->fts_path, link, sizeof(link)-1)) == -1) { warn("readlink: %s", p->fts_path); |
