fixed username function (wtf happened here?)
This commit is contained in:
parent
98f3985d3e
commit
545f1560e6
@ -455,13 +455,14 @@ username(void)
|
||||
uid_t uid = geteuid();
|
||||
struct passwd *pw = getpwuid(uid);
|
||||
|
||||
if (pw == NULL)
|
||||
return smprintf("%s", pw->pw_name);
|
||||
|
||||
if (pw == NULL) {
|
||||
warn("Could not get username");
|
||||
return smprintf(UNKNOWN_STR);
|
||||
}
|
||||
|
||||
return smprintf("%s", pw->pw_name);
|
||||
}
|
||||
|
||||
static char *
|
||||
uid(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user