From d3108db19e256511fe45786b0f2eac5e2d9d901d Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Wed, 7 May 2014 14:40:05 +0200 Subject: [PATCH] last: fix uninitialized length length was unset when using "last --time-format=iso" Signed-off-by: Ruediger Meier --- login-utils/last.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/login-utils/last.c b/login-utils/last.c index 7848dd0da3..7029963cc1 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -434,9 +434,10 @@ static int list(const struct last_control *ctl, struct utmp *p, time_t t, int wh epoch = time(NULL); if (t == epoch) { - if (ctl->fulltime) + if (ctl->fulltime) { sprintf(logouttime, " still running"); - else { + length[0] = 0; + } else { sprintf(logouttime, " still"); sprintf(length, "running"); } -- 2.47.3