From 5491df41027e2159d0015dcbfb1788c54b316ade Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 10 Sep 2014 01:56:09 +0300 Subject: [PATCH] fix progress for small transfers --- datalink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/datalink.c b/datalink.c index a2bdc70..6a37179 100644 --- a/datalink.c +++ b/datalink.c @@ -107,6 +107,9 @@ static void print_progress(int done, int total) printf("%06x/%06x |", done, total); step = total / 20; + if (step <= 0) + step = 1; + for (i = step; i <= total; i += step) printf("%c", done >= i ? '=' : '-'); printf("| %3d%%", done * 100 / total); -- 2.39.5