projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98f3985
)
fixed username function (wtf happened here?)
author
Aaron Marcher
<info@nulltime.net>
Fri, 9 Sep 2016 17:19:46 +0000
(19:19 +0200)
committer
Aaron Marcher (drkhsh)
<info@nulltime.net>
Fri, 9 Sep 2016 17:19:46 +0000
(19:19 +0200)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index 7b85a2385221ec1d66c93450bae70dd8e81722ea..36756600c37ef765706004384cabbad946ca83f1 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-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 *