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:
parent
f97182acf8
commit
d241a89d5c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107856
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user