aboutsummaryrefslogtreecommitdiff
path: root/src/legacy/cuserid.c (follow)
Commit message (Expand)AuthorAgeFilesLines
* fix error return value for cuserid•••the historical function was specified to return an empty string in the caller-provided buffer, not a null pointer, to indicate error when the argument is non-null. only when the argument is null should it return a null pointer on error. Rich Felker2021-02-131-2/+3
* fix misuse of getpwuid_r in cuserid•••getpwuid_r can return 0 but without a result in the case where there was no error but no record exists. in that case cuserid was treating it as success and copying junk out of pw.pw_name to the output buffer. Rich Felker2021-02-131-1/+2
* cuserid: don't return truncated results•••checking the length also drops the need to pull in snprintf. Rich Felker2021-02-131-1/+5
* cuserid: support invocation with a null pointer argument•••this function was removed from the standard in 2001 but appeared in SUSv2 with an obligation to support calls with a null pointer argument, using a static buffer. Sören Tempel2021-02-131-0/+2
* cleanup src/linux and src/misc trees, etc.•••previously, it was pretty much random which one of these trees a given function appeared in. they have now been organized into: src/linux: non-POSIX linux syscalls (possibly shard with other nixen) src/legacy: various obsolete/legacy functions, mostly wrappers src/misc: still mostly uncategorized; some misc POSIX, some nonstd src/crypt: crypt hash functions further cleanup will be done later. Rich Felker2012-09-071-0/+14