summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2015-01-19 14:54:16 +0000
committerokan <okan>2015-01-19 14:54:16 +0000
commit7936b9b2a7c7c3cc06d3fb60c22ed535b610cd63 (patch)
tree9bb4f55aee479f2aa360ccc1dc07946b17ad09c5
parentc412f040df05c7221537a598786e0cea4b35167f (diff)
downloadcwm-7936b9b2a7c7c3cc06d3fb60c22ed535b610cd63.tar.gz
cwm-7936b9b2a7c7c3cc06d3fb60c22ed535b610cd63.tar.xz
cwm-7936b9b2a7c7c3cc06d3fb60c22ed535b610cd63.zip
Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAX
and HOST_NAME_MAX+1, respectively.

ok doug@
-rw-r--r--calmwm.c3
-rw-r--r--calmwm.h4
-rw-r--r--client.c3
-rw-r--r--conf.c3
-rw-r--r--group.c3
-rw-r--r--kbfunc.c9
-rw-r--r--menu.c3
-rw-r--r--mousefunc.c3
-rw-r--r--parse.y2
-rw-r--r--screen.c3
-rw-r--r--search.c5
-rw-r--r--util.c3
-rw-r--r--xevents.c3
-rw-r--r--xmalloc.c3
-rw-r--r--xutil.c3
15 files changed, 33 insertions, 20 deletions
diff --git a/calmwm.c b/calmwm.c
index f85c4c2..2fc0a4f 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -18,13 +18,14 @@
  * $OpenBSD$
  */
 
-#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/calmwm.h b/calmwm.h
index 80e2554..0e5652a 100644
--- a/calmwm.h
+++ b/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/client.c b/client.c
index 1802206..f6aa714 100644
--- a/client.c
+++ b/client.c
@@ -18,12 +18,13 @@
  * $OpenBSD$
  */
 
-#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/conf.c b/conf.c
index 181bf09..8eec4a3 100644
--- a/conf.c
+++ b/conf.c
@@ -18,12 +18,13 @@
  * $OpenBSD$
  */
 
-#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/group.c b/group.c
index 50fb82c..834c2f7 100644
--- a/group.c
+++ b/group.c
@@ -19,12 +19,13 @@
  * $OpenBSD$
  */
 
-#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/kbfunc.c b/kbfunc.c
index c3be2f5..388ead7 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -18,12 +18,13 @@
  * $OpenBSD$
  */
 
-#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/menu.c b/menu.c
index cd84602..f73bc5e 100644
--- a/menu.c
+++ b/menu.c
@@ -19,12 +19,13 @@
  * $OpenBSD$
  */
 
-#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/mousefunc.c b/mousefunc.c
index 1f3cf34..14138a6 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -19,11 +19,12 @@
  * $OpenBSD$
  */
 
-#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/parse.y b/parse.y
index 31d094d..235bca5 100644
--- a/parse.y
+++ b/parse.y
@@ -21,7 +21,7 @@
 
 %{
 
-#include <sys/param.h>
+#include <sys/types.h>
 #include <sys/queue.h>
 
 #include <ctype.h>
diff --git a/screen.c b/screen.c
index 18ffd05..bb7bd9c 100644
--- a/screen.c
+++ b/screen.c
@@ -18,11 +18,12 @@
  * $OpenBSD$
  */
 
-#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/search.c b/search.c
index f0b22ce..ac9f632 100644
--- a/search.c
+++ b/search.c
@@ -18,7 +18,7 @@
  * $OpenBSD$
  */
 
-#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/util.c b/util.c
index f69f880..0b10795 100644
--- a/util.c
+++ b/util.c
@@ -18,11 +18,12 @@
  * $OpenBSD$
  */
 
-#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/xevents.c b/xevents.c
index e2b7178..e6ed84d 100644
--- a/xevents.c
+++ b/xevents.c
@@ -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/xmalloc.c b/xmalloc.c
index 6963c96..2db79ab 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -18,11 +18,12 @@
  * $OpenBSD$
  */
 
-#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/xutil.c b/xutil.c
index 70186f8..edc1426 100644
--- a/xutil.c
+++ b/xutil.c
@@ -18,11 +18,12 @@
  * $OpenBSD$
  */
 
-#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>