diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-11-13 13:58:27 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-11-13 13:58:27 +0100 |
commit | 7698b3a4e1bdd309a77f075e430e9ef2b00d2daa (patch) | |
tree | 2d4895aa7a67160a2c9a8e1d073b683f68f4153e /qlop.c | |
parent | qlop: check return from localtime in fmt_date (diff) | |
download | portage-utils-7698b3a4e1bdd309a77f075e430e9ef2b00d2daa.tar.gz portage-utils-7698b3a4e1bdd309a77f075e430e9ef2b00d2daa.tar.bz2 portage-utils-7698b3a4e1bdd309a77f075e430e9ef2b00d2daa.zip |
qlop: avoid reporting bogus dates in fmt_elapsedtime
when the calculated seconds are negative, we probably had a corrupt log,
so just garbage in/garbage out without trying to interpret it or
something
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Diffstat (limited to 'qlop.c')
-rw-r--r-- | qlop.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -225,7 +225,7 @@ static char *fmt_elapsedtime(struct qlop_mode *flags, time_t e) time_t ss; size_t bufpos = 0; - if (flags->do_machine) { + if (flags->do_machine || e < 0) { snprintf(_elapsed_buf, sizeof(_elapsed_buf), "%s%zd%s", GREEN, (size_t)e, NORM); |