From: Ruediger Meier Date: Wed, 7 May 2014 12:40:05 +0000 (+0200) Subject: last: fix uninitialized length X-Git-Tag: v2.25-rc1~196 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3108db19e256511fe45786b0f2eac5e2d9d901d;p=thirdparty%2Futil-linux.git last: fix uninitialized length length was unset when using "last --time-format=iso" Signed-off-by: Ruediger Meier --- 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"); }