From: notaz Date: Tue, 9 Sep 2014 22:56:09 +0000 (+0300) Subject: fix progress for small transfers X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5491df41027e2159d0015dcbfb1788c54b316ade;p=saturn.git fix progress for small transfers --- 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);