diff options
author | Ruediger Meier | 2014-05-08 18:48:21 +0200 |
---|---|---|
committer | Ruediger Meier | 2014-05-08 22:14:27 +0200 |
commit | 4fcbfaa81d2831acbefe11fcdaed3eaa931475fc (patch) | |
tree | 76340e68da33aa16ead7ab825ef0c8a3f4181c98 /login-utils/last.c | |
parent | tests: add test case for last -time-format=full (diff) | |
download | kernel-qcow2-util-linux-4fcbfaa81d2831acbefe11fcdaed3eaa931475fc.tar.gz kernel-qcow2-util-linux-4fcbfaa81d2831acbefe11fcdaed3eaa931475fc.tar.xz kernel-qcow2-util-linux-4fcbfaa81d2831acbefe11fcdaed3eaa931475fc.zip |
last: minor cleanup if statements
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r-- | login-utils/last.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/login-utils/last.c b/login-utils/last.c index 693546403..3a802eda6 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -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"); } |