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 /app/cwm/kbfunc.c | |
parent | 5d5975a6f5c35d84dbfb5d5b769329c81ec2d221 (diff) |
Switch to limits.h; replace MAXPATHLEN and MAXHOSTNAMELEN with PATH_MAX
and HOST_NAME_MAX+1, respectively.
ok doug@
Diffstat (limited to 'app/cwm/kbfunc.c')
-rw-r--r-- | app/cwm/kbfunc.c | 11 |
1 files changed, 6 insertions, 5 deletions
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; |