This fixes two checks where we compare string sizes when validating with
FILENAME_MAX. In both cases the check apparently wants to check if the
name fits in a filename, but that's not actually what FILENAME_MAX can
be used for, as it — in contrast to what the name suggests — actually
encodes the maximum length of a path.
In both cases the stricter change doesn't actually change much, but the
use of FILENAME_MAX is still misleading and typically wrong.
if (!strchr(CONTROLLER_VALID, *t))
return false;
- if (t - p > FILENAME_MAX)
+ if (t - p > NAME_MAX)
return false;
return true;
if (l > (size_t) sz)
return false;
- if (l > FILENAME_MAX)
+ if (l > NAME_MAX) /* must fit in a filename */
return false;
if (l > UT_NAMESIZE - 1)
return false;