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:
e43c3a1
)
user: Only declare variables in the beginning
author
Aaron Marcher
<me@drkhsh.at>
Wed, 2 May 2018 06:42:55 +0000
(08:42 +0200)
committer
Aaron Marcher
<me@drkhsh.at>
Wed, 2 May 2018 06:42:55 +0000
(08:42 +0200)
components/user.c
patch
|
blob
|
history
diff --git
a/components/user.c
b/components/user.c
index b335dc3e62fe2426fe197426362565a9d8405f8e..8ab6db9b9df0e8a3b9190ff5fd59f1f5c10dffb9 100644
(file)
--- a/
components/user.c
+++ b/
components/user.c
@@
-17,9
+17,9
@@
gid(void)
const char *
username(void)
{
- struct passwd *pw
= getpwuid(geteuid())
;
+ struct passwd *pw;
- if (
pw == NULL
) {
+ if (
!(pw = getpwuid(geteuid()))
) {
fprintf(stderr, "getpwuid '%d': %s\n", geteuid(), strerror(errno));
return NULL;
}