diff options
author | Ruediger Meier | 2014-05-07 14:40:05 +0200 |
---|---|---|
committer | Ruediger Meier | 2014-05-07 14:42:36 +0200 |
commit | d3108db19e256511fe45786b0f2eac5e2d9d901d (patch) | |
tree | 8e5b2f10c3027fe2b32526a4f33054e483d43fb3 /login-utils | |
parent | libsmartcols: (docs) reorder functions in version section (diff) | |
download | kernel-qcow2-util-linux-d3108db19e256511fe45786b0f2eac5e2d9d901d.tar.gz kernel-qcow2-util-linux-d3108db19e256511fe45786b0f2eac5e2d9d901d.tar.xz kernel-qcow2-util-linux-d3108db19e256511fe45786b0f2eac5e2d9d901d.zip |
last: fix uninitialized length
length was unset when using "last --time-format=iso"
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/last.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/login-utils/last.c b/login-utils/last.c index 7848dd0da..7029963cc 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"); } |