aboutsummaryrefslogtreecommitdiffstats
path: root/sercp.c
diff options
context:
space:
mode:
authorPavel Vymetálek <pavel@vym.cz>2021-01-20 13:31:57 +0100
committerPavel Vymetálek <pavel@vym.cz>2021-01-20 13:31:57 +0100
commit139969ef7b0ac660853899ac601bab330c111f71 (patch)
tree1288d9298f2ffbe00466c64f58d7ccdb59f202f1 /sercp.c
parent8679629f8c9f6a45b3b44ca2f2f613232b7607dd (diff)
downloadsercp-pc-139969ef7b0ac660853899ac601bab330c111f71.tar.gz
Fixed integer rounding - progress show 100% at the finishv0.3.6
Diffstat (limited to 'sercp.c')
-rw-r--r--sercp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sercp.c b/sercp.c
index f19fea4..66baefb 100644
--- a/sercp.c
+++ b/sercp.c
@@ -68,7 +68,7 @@
#define FALSE 0
#define true 1
#define TRUE 1
-const char* _version = "v0.3.5";
+const char* _version = "v0.3.6";
// SERIAL
FILE *tapout_fd = NULL;
int is_outfile = 0;
@@ -293,7 +293,7 @@ void DoProgress(size_t pos, size_t max, unsigned char csum_ok) {
char progress_char;
p = pos;
m = max;
- percent = 100 / m * p;
+ percent = (100 / m * p) + 0.5;
ipercent = percent / 100 * imax;
if (is_binary) progress_char = '#';
else progress_char = '=';