HomeFreeBSD

which: Use size_t instead of ssize_t for pathlen

Description

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

Details

Provenance
collin.funk1_gmail.comAuthored on Feb 11 2024, 4:26 AM
markjCommitted on Apr 5 2024, 6:30 PM
Parents
rGda2b732288c7: arm64: add CPU part identifiers for Apple M1 and M2
Branches
Unknown
Tags
Unknown