Browse Source

user: Only declare variables in the beginning

master
Aaron Marcher 8 years ago
parent
commit
709549b4bd
  1. 4
      components/user.c

4
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;
}

Loading…
Cancel
Save