1
0
mirror of git://git.suckless.org/slstatus synced 2025-03-02 11:30:23 +00:00

fixed username function (wtf happened here?)

This commit is contained in:
Aaron Marcher 2016-09-09 19:19:46 +02:00 committed by Aaron Marcher (drkhsh)
parent 98f3985d3e
commit 545f1560e6

View File

@ -455,11 +455,12 @@ 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 *