From: Ruediger Meier Date: Thu, 8 May 2014 16:48:21 +0000 (+0200) Subject: last: minor cleanup if statements X-Git-Tag: v2.25-rc1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fcbfaa81d2831acbefe11fcdaed3eaa931475fc;p=thirdparty%2Futil-linux.git last: minor cleanup if statements Signed-off-by: Ruediger Meier --- diff --git a/login-utils/last.c b/login-utils/last.c index 6935464031..3a802eda6d 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"); }