fix progress for small transfers
authornotaz <notasas@gmail.com>
Tue, 9 Sep 2014 22:56:09 +0000 (01:56 +0300)
committernotaz <notasas@gmail.com>
Tue, 9 Sep 2014 22:56:09 +0000 (01:56 +0300)
datalink.c

index a2bdc70..6a37179 100644 (file)
@@ -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);