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 /usr.bin/tput | |
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 'usr.bin/tput')
-rw-r--r-- | usr.bin/tput/tput.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c index 84bafe6e787..fbe7f672fab 100644 --- a/usr.bin/tput/tput.c +++ b/usr.bin/tput/tput.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tput.c,v 1.20 2014/10/08 04:10:47 doug Exp $ */ +/* $OpenBSD: tput.c,v 1.21 2015/01/16 06:40:13 deraadt Exp $ */ /* * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com> @@ -44,8 +44,6 @@ * SUCH DAMAGE. */ -#include <sys/param.h> - #include <ctype.h> #include <err.h> #include <curses.h> @@ -54,8 +52,11 @@ #include <stdlib.h> #include <termios.h> #include <unistd.h> +#include <limits.h> #include <string.h> +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + #include <sys/wait.h> static void init(void); @@ -229,7 +230,7 @@ process(char *cap, char *str, char **argv) } } } - arg_need = MAX(arg_need, popcount); + arg_need = MAXIMUM(arg_need, popcount); if (arg_need > 9) errx(2, "too many arguments (%d) for capability `%s'", arg_need, cap); |