fixed username function (wtf happened here?)
This commit is contained in:
parent
98f3985d3e
commit
545f1560e6
1 changed files with 5 additions and 4 deletions
|
@ -455,11 +455,12 @@ username(void)
|
||||||
uid_t uid = geteuid();
|
uid_t uid = geteuid();
|
||||||
struct passwd *pw = getpwuid(uid);
|
struct passwd *pw = getpwuid(uid);
|
||||||
|
|
||||||
if (pw == NULL)
|
if (pw == NULL) {
|
||||||
return smprintf("%s", pw->pw_name);
|
|
||||||
|
|
||||||
warn("Could not get username");
|
warn("Could not get username");
|
||||||
return smprintf(UNKNOWN_STR);
|
return smprintf(UNKNOWN_STR);
|
||||||
|
}
|
||||||
|
|
||||||
|
return smprintf("%s", pw->pw_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
|
Loading…
Reference in a new issue