diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2015-01-19 14:54:17 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2015-01-19 14:54:17 +0000 |
commit | 0c730e4a673c72964e2d307b136fa9c80c26b2fe (patch) | |
tree | 324c818f1d34934863bad4dbc567fbba7132356e | |
parent | 5d5975a6f5c35d84dbfb5d5b769329c81ec2d221 (diff) |
Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAX
and HOST_NAME_MAX+1, respectively.
ok doug@
-rw-r--r-- | app/cwm/calmwm.c | 5 | ||||
-rw-r--r-- | app/cwm/calmwm.h | 6 | ||||
-rw-r--r-- | app/cwm/client.c | 5 | ||||
-rw-r--r-- | app/cwm/conf.c | 5 | ||||
-rw-r--r-- | app/cwm/group.c | 5 | ||||
-rw-r--r-- | app/cwm/kbfunc.c | 11 | ||||
-rw-r--r-- | app/cwm/menu.c | 5 | ||||
-rw-r--r-- | app/cwm/mousefunc.c | 5 | ||||
-rw-r--r-- | app/cwm/parse.y | 4 | ||||
-rw-r--r-- | app/cwm/screen.c | 5 | ||||
-rw-r--r-- | app/cwm/search.c | 7 | ||||
-rw-r--r-- | app/cwm/util.c | 5 | ||||
-rw-r--r-- | app/cwm/xevents.c | 5 | ||||
-rw-r--r-- | app/cwm/xmalloc.c | 5 | ||||
-rw-r--r-- | app/cwm/xutil.c | 5 |
15 files changed, 48 insertions, 35 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c index a74a0fbb8..f0d009b12 100644 --- a/app/cwm/calmwm.c +++ b/app/cwm/calmwm.c @@ -15,16 +15,17 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.c,v 1.92 2014/09/08 20:11:22 okan Exp $ + * $OpenBSD: calmwm.c,v 1.93 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <sys/wait.h> #include <err.h> #include <errno.h> #include <getopt.h> +#include <limits.h> #include <locale.h> #include <pwd.h> #include <signal.h> diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h index 67b336c87..955d9fc2c 100644 --- a/app/cwm/calmwm.h +++ b/app/cwm/calmwm.h @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.283 2014/10/08 12:48:51 okan Exp $ + * $OpenBSD: calmwm.h,v 1.284 2015/01/19 14:54:16 okan Exp $ */ #ifndef _CALMWM_H_ @@ -260,7 +260,7 @@ TAILQ_HEAD(mousebinding_q, binding); struct cmd { TAILQ_ENTRY(cmd) entry; char *name; - char path[MAXPATHLEN]; + char path[PATH_MAX]; }; TAILQ_HEAD(cmd_q, cmd); @@ -292,7 +292,7 @@ struct conf { int snapdist; struct gap gap; char *color[CWM_COLOR_NITEMS]; - char known_hosts[MAXPATHLEN]; + char known_hosts[PATH_MAX]; #define CONF_FONT "sans-serif:pixelsize=14:bold" char *font; Cursor cursor[CF_NITEMS]; diff --git a/app/cwm/client.c b/app/cwm/client.c index c2cddb448..1dc61f821 100644 --- a/app/cwm/client.c +++ b/app/cwm/client.c @@ -15,15 +15,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: client.c,v 1.188 2014/09/27 19:04:32 okan Exp $ + * $OpenBSD: client.c,v 1.189 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <assert.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/conf.c b/app/cwm/conf.c index 361570150..243965914 100644 --- a/app/cwm/conf.c +++ b/app/cwm/conf.c @@ -15,15 +15,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.181 2014/09/17 18:41:44 okan Exp $ + * $OpenBSD: conf.c,v 1.182 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <sys/stat.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/group.c b/app/cwm/group.c index 87c307d16..a5f485957 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.c @@ -16,15 +16,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: group.c,v 1.109 2014/10/08 12:48:51 okan Exp $ + * $OpenBSD: group.c,v 1.110 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <assert.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index d5afd1f0b..e6798f940 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/kbfunc.c @@ -15,15 +15,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.104 2014/09/27 19:04:32 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.105 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <dirent.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <paths.h> #include <signal.h> #include <stdio.h> @@ -238,7 +239,7 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg) #define NPATHS 256 struct screen_ctx *sc = cc->sc; char **ap, *paths[NPATHS], *path, *pathcpy; - char tpath[MAXPATHLEN]; + char tpath[PATH_MAX]; const char *label; DIR *dirp; struct dirent *dp; @@ -323,8 +324,8 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg) struct menu_q menuq; FILE *fp; char *buf, *lbuf, *p; - char hostbuf[MAXHOSTNAMELEN]; - char path[MAXPATHLEN]; + char hostbuf[HOST_NAME_MAX+1]; + char path[PATH_MAX]; int l; size_t len; diff --git a/app/cwm/menu.c b/app/cwm/menu.c index 450fa4d9d..6c04fd6b0 100644 --- a/app/cwm/menu.c +++ b/app/cwm/menu.c @@ -16,15 +16,16 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: menu.c,v 1.77 2014/09/07 19:27:30 okan Exp $ + * $OpenBSD: menu.c,v 1.78 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <ctype.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> diff --git a/app/cwm/mousefunc.c b/app/cwm/mousefunc.c index 1edf5e584..443b888fd 100644 --- a/app/cwm/mousefunc.c +++ b/app/cwm/mousefunc.c @@ -16,14 +16,15 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.85 2014/09/27 19:04:32 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.86 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/parse.y b/app/cwm/parse.y index 2ee5727bb..5aa07d0d0 100644 --- a/app/cwm/parse.y +++ b/app/cwm/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.60 2015/01/17 02:05:03 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.61 2015/01/19 14:54:16 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -21,7 +21,7 @@ %{ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <ctype.h> diff --git a/app/cwm/screen.c b/app/cwm/screen.c index 4ca44a9b6..4e7c617c6 100644 --- a/app/cwm/screen.c +++ b/app/cwm/screen.c @@ -15,14 +15,15 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: screen.c,v 1.70 2014/10/08 15:31:01 okan Exp $ + * $OpenBSD: screen.c,v 1.71 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/search.c b/app/cwm/search.c index 7e55a51cb..0acfd2c9a 100644 --- a/app/cwm/search.c +++ b/app/cwm/search.c @@ -15,10 +15,10 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: search.c,v 1.41 2014/09/15 13:00:49 okan Exp $ + * $OpenBSD: search.c,v 1.42 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <assert.h> @@ -26,6 +26,7 @@ #include <errno.h> #include <fnmatch.h> #include <glob.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -172,7 +173,7 @@ search_print_client(struct menu *mi, int list) static void search_match_path(struct menu_q *menuq, struct menu_q *resultq, char *search, int flag) { - char pattern[MAXPATHLEN]; + char pattern[PATH_MAX]; glob_t g; int i; diff --git a/app/cwm/util.c b/app/cwm/util.c index 8220d2f42..9480448de 100644 --- a/app/cwm/util.c +++ b/app/cwm/util.c @@ -15,14 +15,15 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: util.c,v 1.16 2012/11/09 03:52:02 okan Exp $ + * $OpenBSD: util.c,v 1.17 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/xevents.c b/app/cwm/xevents.c index 1f297a5c9..b1582886c 100644 --- a/app/cwm/xevents.c +++ b/app/cwm/xevents.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xevents.c,v 1.115 2014/09/27 19:04:32 okan Exp $ + * $OpenBSD: xevents.c,v 1.116 2015/01/19 14:54:16 okan Exp $ */ /* @@ -24,11 +24,12 @@ * management of the xevent's. */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/app/cwm/xmalloc.c b/app/cwm/xmalloc.c index 2aa666b0e..94f06913b 100644 --- a/app/cwm/xmalloc.c +++ b/app/cwm/xmalloc.c @@ -15,14 +15,15 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xmalloc.c,v 1.13 2014/09/07 19:27:30 okan Exp $ + * $OpenBSD: xmalloc.c,v 1.14 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> diff --git a/app/cwm/xutil.c b/app/cwm/xutil.c index 26188af7c..8cd5d0725 100644 --- a/app/cwm/xutil.c +++ b/app/cwm/xutil.c @@ -15,14 +15,15 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: xutil.c,v 1.96 2014/09/23 14:25:08 okan Exp $ + * $OpenBSD: xutil.c,v 1.97 2015/01/19 14:54:16 okan Exp $ */ -#include <sys/param.h> +#include <sys/types.h> #include <sys/queue.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> |