diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-06-05 02:00:26 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-06-05 02:00:26 +0000 |
commit | 8400486b39e9f57a03d2efe49cf8eab233476669 (patch) | |
tree | 05031258c9f3babdf621263c0a55031f2a2a2c0a /manpage.c | |
parent | 91ed0105333c4ac483f7581f13a317c5560bdf58 (diff) | |
download | mandoc-8400486b39e9f57a03d2efe49cf8eab233476669.tar.gz mandoc-8400486b39e9f57a03d2efe49cf8eab233476669.tar.zst mandoc-8400486b39e9f57a03d2efe49cf8eab233476669.zip |
Some places used PATH_MAX from <limits.h>, some MAXPATHLEN from <sys/param.h>.
Consistently use the PATH_MAX since it is specified by POSIX,
while MAXPATHLEN is not.
In preparation for using this at a few more places.
Diffstat (limited to 'manpage.c')
-rw-r--r-- | manpage.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: manpage.c,v 1.3 2012/06/09 17:49:13 kristaps Exp $ */ +/* $Id: manpage.c,v 1.4 2013/06/05 02:00:26 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -17,10 +17,10 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include <sys/param.h> #include <assert.h> #include <getopt.h> +#include <limits.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -40,7 +40,7 @@ main(int argc, char *argv[]) struct mansearch search; struct manpage *res; char *conf_file, *defpaths, *auxpaths, *cp; - char buf[MAXPATHLEN]; + char buf[PATH_MAX]; const char *cmd; struct manpaths paths; char *progname; @@ -132,7 +132,7 @@ main(int argc, char *argv[]) } show: cmd = res[i - 1].form ? "mandoc" : "cat"; - strlcpy(buf, res[i - 1].file, MAXPATHLEN); + strlcpy(buf, res[i - 1].file, PATH_MAX); free(res); show(cmd, buf); |