]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
last: minor cleanup if statements
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 8 May 2014 16:48:21 +0000 (18:48 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 8 May 2014 20:14:27 +0000 (22:14 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
login-utils/last.c

index 6935464031cf4ea8f84ac5b7d07951c7a2afdcac..3a802eda6d1dbfbe93d1d4dc7da14d4140bd97d4 100644 (file)
@@ -453,19 +453,19 @@ static int list(const struct last_control *ctl, struct utmp *p, time_t t, int wh
                        sprintf(logouttime, "- down ");
                        break;
                case R_NOW:
-                       length[0] = 0;
-                       if (ctl->time_fmt > LAST_TIMEFTM_SHORT_CTIME)
+                       if (ctl->time_fmt > LAST_TIMEFTM_SHORT_CTIME) {
                                sprintf(logouttime, "  still logged in");
-                       else {
+                               length[0] = 0;
+                       } else {
                                sprintf(logouttime, "  still");
                                sprintf(length, "logged in");
                        }
                        break;
                case R_PHANTOM:
-                       length[0] = 0;
-                       if (ctl->time_fmt > LAST_TIMEFTM_SHORT_CTIME)
+                       if (ctl->time_fmt > LAST_TIMEFTM_SHORT_CTIME) {
                                sprintf(logouttime, "  gone - no logout");
-                       else {
+                               length[0] = 0;
+                       } else {
                                sprintf(logouttime, "   gone");
                                sprintf(length, "- no logout");
                        }