=================================================================== RCS file: /cvs/mandoc/mansearch.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -p -r1.5 -r1.6 --- mandoc/mansearch.c 2012/06/09 14:11:16 1.5 +++ mandoc/mansearch.c 2013/06/05 02:00:26 1.6 @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.5 2012/06/09 14:11:16 kristaps Exp $ */ +/* $Id: mansearch.c,v 1.6 2013/06/05 02:00:26 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * @@ -18,11 +18,10 @@ #include "config.h" #endif -#include - #include #include #include +#include #include #include #include @@ -131,7 +130,7 @@ mansearch(const struct mansearch *search, { int fd, rc, c; int64_t id; - char buf[MAXPATHLEN]; + char buf[PATH_MAX]; char *sql; struct expr *e, *ep; sqlite3 *db; @@ -168,7 +167,7 @@ mansearch(const struct mansearch *search, * on our current directory from which to start the chdir(). */ - if (NULL == getcwd(buf, MAXPATHLEN)) { + if (NULL == getcwd(buf, PATH_MAX)) { perror(NULL); goto out; } else if (-1 == (fd = open(buf, O_RDONLY, 0))) { @@ -266,9 +265,9 @@ mansearch(const struct mansearch *search, (*res, maxres * sizeof(struct manpage)); } strlcpy((*res)[cur].file, - paths->paths[i], MAXPATHLEN); - strlcat((*res)[cur].file, "/", MAXPATHLEN); - strlcat((*res)[cur].file, mp->file, MAXPATHLEN); + paths->paths[i], PATH_MAX); + strlcat((*res)[cur].file, "/", PATH_MAX); + strlcat((*res)[cur].file, mp->file, PATH_MAX); (*res)[cur].desc = mp->desc; (*res)[cur].form = mp->form; free(mp->file);