diff options
author | Aaron Marcher <info@nulltime.net> | 2016-09-09 19:19:46 +0200 |
---|---|---|
committer | Aaron Marcher (drkhsh) <info@nulltime.net> | 2016-09-09 19:19:46 +0200 |
commit | 545f1560e6b019a49f9df7f7f16e861b58ce51f4 (patch) | |
tree | 94b3638f77791af42a9b241488ec4c00e488ad42 /slstatus.c | |
parent | 98f3985d3ee542fe98b8182ed8f4ced632032b31 (diff) |
fixed username function (wtf happened here?)
Diffstat (limited to 'slstatus.c')
-rw-r--r-- | slstatus.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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); + } - warn("Could not get username"); - return smprintf(UNKNOWN_STR); + return smprintf("%s", pw->pw_name); } static char * |