]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
last: fix uninitialized length
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 7 May 2014 12:40:05 +0000 (14:40 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 7 May 2014 12:42:36 +0000 (14:42 +0200)
length was unset when using "last --time-format=iso"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
login-utils/last.c

index 7848dd0da32cbb46942577b02bebffb5b3e707aa..7029963cc151fc278767f07c4099dab900638689 100644 (file)
@@ -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");
                }