diff options
Diffstat (limited to 'libc/unistd/getlogin.c')
-rw-r--r-- | libc/unistd/getlogin.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libc/unistd/getlogin.c b/libc/unistd/getlogin.c index 0747a49f6..f2ee1d355 100644 --- a/libc/unistd/getlogin.c +++ b/libc/unistd/getlogin.c @@ -23,35 +23,40 @@ #include <stdlib.h> #include <string.h> +libc_hidden_proto(strcpy) +libc_hidden_proto(strncpy) +libc_hidden_proto(getenv) + /* uClibc makes it policy to not mess with the utmp file whenever * possible, since I consider utmp a complete waste of time. Since * getlogin() should never be used for security purposes, we kindly let * the user specify whatever they want via the LOGNAME environment * variable, or we return NULL if getenv() fails to find anything */ -extern char attribute_hidden * __getlogin(void) +char * getlogin(void) { - return (__getenv("LOGNAME")); + return (getenv("LOGNAME")); } -strong_alias(__getlogin,getlogin) +libc_hidden_proto(getlogin) +libc_hidden_def(getlogin) int getlogin_r(char *name, size_t len) { - char * foo = __getenv("LOGNAME"); + char * foo = getenv("LOGNAME"); if (! foo) return -1; - __strncpy(name, foo, len); + strncpy(name, foo, len); name[len-1] = '\0'; return 0; } char *cuserid(char *s) { - char *name = __getlogin(); + char *name = getlogin(); if (s) { - return(__strcpy(s, name ? name : "")); + return(strcpy(s, name ? name : "")); } return name; } |