summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-12-15 00:40:47 +0000
committertjr <tjr@FreeBSD.org>2002-12-15 00:40:47 +0000
commitd1851c5aa8f69bb78591a02d70cb00ce27c211bf (patch)
tree728e6bb2ba282a548f295c0ad369e44a107c52ab /usr.bin
parent339c5b2dab81223a690db21a22858336229504c4 (diff)
downloadFreeBSD-src-d1851c5aa8f69bb78591a02d70cb00ce27c211bf.zip
FreeBSD-src-d1851c5aa8f69bb78591a02d70cb00ce27c211bf.tar.gz
Unbreak support for systems that have no limit on pathname length.
Noticed by: bde
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/pathchk/pathchk.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/pathchk/pathchk.c b/usr.bin/pathchk/pathchk.c
index d156185..2b31099 100644
--- a/usr.bin/pathchk/pathchk.c
+++ b/usr.bin/pathchk/pathchk.c
@@ -157,10 +157,8 @@ check(const char *path)
pathmax = PATH_MAX;
} else
pathmax = _POSIX_PATH_MAX;
- /* PATH_MAX includes space for the trailing null byte. */
- pathmax--;
- if (pathmax != -1 && strlen(path) > (size_t)pathmax) {
- warnx("%s: path too long (limit %ld)", path, pathmax);
+ if (pathmax != -1 && strlen(path) >= (size_t)pathmax) {
+ warnx("%s: path too long (limit %ld)", path, pathmax - 1);
goto bad;
}
OpenPOWER on IntegriCloud