diff options
author | Aaron Marcher <me@drkhsh.at> | 2018-05-02 08:42:55 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-05-02 08:42:55 +0200 |
commit | a1821e2617dda89660662b1f4e46f324911f89f8 (patch) | |
tree | ec5bde8cc474fae77be855bdcfb84c791ee2b386 /components | |
parent | 4ee8f5476e3be3ffc69c39af369fd5a3c79df60f (diff) |
user: Only declare variables in the beginning
Diffstat (limited to 'components')
-rw-r--r-- | components/user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/user.c b/components/user.c index b335dc3..8ab6db9 100644 --- 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; } |