[openssh-commits] [openssh] 02/02: upstream: Remove dead code ternary. We always report at least

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Jun 11 23:35:25 AEST 2025


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 5d415897ac04e237f1fa73b9dcb9ba8fb3ac812b
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Wed Jun 11 13:27:11 2025 +0000

    upstream: Remove dead code ternary. We always report at least
    
    KB/s, so B/s is never used.  Coverity CID 291809, ok djm@
    
    OpenBSD-Commit-ID: a67c5bcc9e19c8965bfeace0e337b13660efa058
---
 progressmeter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/progressmeter.c b/progressmeter.c
index 0d1faba39..2c169768f 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: progressmeter.c,v 1.55 2025/05/09 02:42:03 djm Exp $ */
+/* $OpenBSD: progressmeter.c,v 1.56 2025/06/11 13:27:11 dtucker Exp $ */
 /*
  * Copyright (c) 2003 Nils Nordman.  All rights reserved.
  *
@@ -93,15 +93,15 @@ format_rate(off_t bytes)
 	bytes *= 100;
 	for (i = 0; bytes >= 100*1000 && unit[i] != 'T'; i++)
 		bytes = (bytes + 512) / 1024;
+	/* Display at least KB, even when rate is low or zero. */
 	if (i == 0) {
 		i++;
 		bytes = (bytes + 512) / 1024;
 	}
-	snprintf(buf, sizeof(buf), "%3lld.%1lld%c%s",
+	snprintf(buf, sizeof(buf), "%3lld.%1lld%cB",
 	    (long long) (bytes + 5) / 100,
 	    (long long) (bytes + 5) / 10 % 10,
-	    unit[i],
-	    i ? "B" : " ");
+	    unit[i]);
 	return buf;
 }
 

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list