fixed username function (wtf happened here?)
authorAaron Marcher <info@nulltime.net>
Fri, 9 Sep 2016 17:19:46 +0000 (19:19 +0200)
committerAaron Marcher (drkhsh) <info@nulltime.net>
Fri, 9 Sep 2016 17:19:46 +0000 (19:19 +0200)
slstatus.c

index 7b85a2385221ec1d66c93450bae70dd8e81722ea..36756600c37ef765706004384cabbad946ca83f1 100644 (file)
@@ -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 *