which: Use size_t instead of ssize_t for pathlen

The "pathlen" variable is the return value of strlen(3) and is then
passed as an argument to malloc(3) and memcpy(3). The size_t type
matches the prototype for these functions. The size_t type is unsigned
so it can fit larger $PATH values than ssize_t. However, in practice
ssize_t should be larger enough so this change is just for clarity.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1113
This commit is contained in:
Collin Funk 2024-02-10 20:26:38 -08:00 committed by Mark Johnston
parent da2b732288
commit 8268a31bcc
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ int
main(int argc, char **argv)
{
char *p, *path;
ssize_t pathlen;
size_t pathlen;
int opt, status;
status = EXIT_SUCCESS;