Xinqi Bao's Git

updated ram_total and ram_free (obsd)
[slstatus.git] / components / user.c
index b335dc3..8ab6db9 100644 (file)
@@ -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;
        }