diff options
| author | 2015-01-16 06:39:28 +0000 | |
|---|---|---|
| committer | 2015-01-16 06:39:28 +0000 | |
| commit | b9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch) | |
| tree | 72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.bin/indent/indent.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 'usr.bin/indent/indent.c')
| -rw-r--r-- | usr.bin/indent/indent.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index 1bff676952b..ad33d215568 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: indent.c,v 1.25 2014/07/20 01:38:40 guenther Exp $ */ +/* $OpenBSD: indent.c,v 1.26 2015/01/16 06:40:08 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -32,9 +32,9 @@ * SUCH DAMAGE. */ -#include <sys/param.h> #include <fcntl.h> #include <unistd.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -48,7 +48,7 @@ char *in_name = "Standard Input"; /* will always point to name of input * file */ char *out_name = "Standard Output"; /* will always point to name * of output file */ -char bakfile[MAXPATHLEN] = ""; +char bakfile[PATH_MAX] = ""; void bakcopy(void); @@ -1178,7 +1178,7 @@ bakcopy(void) p--; if (*p == '/') p++; - if (snprintf(bakfile, MAXPATHLEN, "%s.BAK", p) >= MAXPATHLEN) + if (snprintf(bakfile, PATH_MAX, "%s.BAK", p) >= PATH_MAX) errc(1, ENAMETOOLONG, "%s.BAK", p); /* copy in_name to backup file */ |
