summaryrefslogtreecommitdiffstats
path: root/manpage.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-06-05 02:00:26 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-06-05 02:00:26 +0000
commitb89434f21ae046433285c9cbccd06a7e60481404 (patch)
treef9d6f3fb89af641748aca368db8213fcb4875386 /manpage.c
parent38f6d7addec36d20d9119077b886c125c21451af (diff)
downloadmandoc-b89434f21ae046433285c9cbccd06a7e60481404.tar.gz
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/manpage.c b/manpage.c
index de5db112..e1ef6a27 100644
--- a/manpage.c
+++ b/manpage.c
@@ -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);