fixed username function (wtf happened here?)
Aaron Marcher info@nulltime.net
Fri, 09 Sep 2016 19:19:46 +0200
1 files changed,
5 insertions(+),
4 deletions(-)
jump to
M
slstatus.c
→
slstatus.c
@@ -455,11 +455,12 @@ {
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); + } - warn("Could not get username"); - return smprintf(UNKNOWN_STR); + return smprintf("%s", pw->pw_name); } static char *