summaryrefslogtreecommitdiff
path: root/src/legacy/cuserid.c
AgeCommit message (Collapse)AuthorLines
2021-02-13fix error return value for cuseridRich Felker-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.
2021-02-13fix misuse of getpwuid_r in cuseridRich Felker-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.
2021-02-13cuserid: don't return truncated resultsRich Felker-1/+5
checking the length also drops the need to pull in snprintf.
2021-02-13cuserid: support invocation with a null pointer argumentSören Tempel-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.
2012-09-07cleanup src/linux and src/misc trees, etc.Rich Felker-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.