[openssh-commits] [openssh] 02/05: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Jul 8 13:51:44 AEST 2016


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

djm pushed a commit to branch master
in repository openssh.

commit e683fc6f1c8c7295648dbda679df8307786ec1ce
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date:   Thu Jun 30 05:17:05 2016 +0000

    upstream commit
    
    Explicitly check for 100% completion to avoid potential
    floating point rounding error, which could cause progressmeter to report 99%
    on completion. While there invert the test so the 100% case is clearer.  with
    & ok djm@
    
    Upstream-ID: a166870c5878e422f3c71ff802e2ccd7032f715d
---
 progressmeter.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/progressmeter.c b/progressmeter.c
index d3e0223..fe9bf52 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: progressmeter.c,v 1.44 2016/05/30 18:34:41 schwarze Exp $ */
+/* $OpenBSD: progressmeter.c,v 1.45 2016/06/30 05:17:05 dtucker Exp $ */
 /*
  * Copyright (c) 2003 Nils Nordman.  All rights reserved.
  *
@@ -171,10 +171,10 @@ refresh_progress_meter(void)
 	}
 
 	/* percent of transfer done */
-	if (end_pos != 0)
-		percent = ((float)cur_pos / end_pos) * 100;
-	else
+	if (end_pos == 0 || cur_pos == end_pos)
 		percent = 100;
+	else
+		percent = ((float)cur_pos / end_pos) * 100;
 	snprintf(buf + strlen(buf), win_size - strlen(buf),
 	    " %3d%% ", percent);
 

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


More information about the openssh-commits mailing list