about summary refs log tree commit diff
path: root/src/legacy/cuserid.c
Commit message (Collapse)AuthorAgeFilesLines
* fix error return value for cuseridRich Felker2021-02-131-2/+3
| | | | | | | 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.
* fix misuse of getpwuid_r in cuseridRich Felker2021-02-131-1/+2
| | | | | | 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.
* cuserid: don't return truncated resultsRich Felker2021-02-131-1/+5
| | | | checking the length also drops the need to pull in snprintf.
* cuserid: support invocation with a null pointer argumentSören Tempel2021-02-131-0/+2
| | | | | | 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.
* cleanup src/linux and src/misc trees, etc.Rich Felker2012-09-071-0/+14
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.