From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7898B139117 for ; Wed, 13 Nov 2019 12:59:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92A8AE0900; Wed, 13 Nov 2019 12:59:48 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 689C3E0900 for ; Wed, 13 Nov 2019 12:59:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 24B0634CD76 for ; Wed, 13 Nov 2019 12:59:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CD60B26C for ; Wed, 13 Nov 2019 12:59:45 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1573649907.7698b3a4e1bdd309a77f075e430e9ef2b00d2daa.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlop.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 7698b3a4e1bdd309a77f075e430e9ef2b00d2daa X-VCS-Branch: master Date: Wed, 13 Nov 2019 12:59:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7c7f0146-a38a-4fd6-be36-ecbfd663d694 X-Archives-Hash: c92b6cb86fb386053faf3852325ff1a5 commit: 7698b3a4e1bdd309a77f075e430e9ef2b00d2daa Author: Fabian Groffen gentoo org> AuthorDate: Wed Nov 13 12:58:27 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Nov 13 12:58:27 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7698b3a4 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 gentoo.org> qlop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qlop.c b/qlop.c index 95cd64b..dcf1d47 100644 --- a/qlop.c +++ b/qlop.c @@ -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);