Update pathchk to reflect the fact that 1003.1-2001 now includes the

trailing null byte in PATH_MAX and _POSIX_PATH_MAX.

PR:		46035
This commit is contained in:
Tim J. Robbins 2002-12-14 11:44:54 +00:00
parent f97182acf8
commit d241a89d5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107856

View File

@ -157,6 +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);
goto bad;