diff --git a/src/progress.c b/src/progress.c index 5ba542d..1611599 100644 --- a/src/progress.c +++ b/src/progress.c @@ -907,10 +907,6 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done) char *p = bp->buffer; wgint size = bp->initial_length + bp->count; - const char *size_grouped = with_thousand_seps (size); - int size_grouped_len = count_cols (size_grouped); - /* Difference between num cols and num bytes: */ - int size_grouped_diff = strlen (size_grouped) - size_grouped_len; int size_grouped_pad; /* Used to pad the field width for size_grouped. */ struct bar_progress_hist *hist = &bp->hist; @@ -969,7 +965,7 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done) int *cols_ret = &col; if (((orig_filename_cols > MAX_FILENAME_COLS) && !opt.noscroll) && !done) - offset_cols = ((int) bp->tick) % (orig_filename_cols - MAX_FILENAME_COLS); + offset_cols = ((int) bp->tick) % (orig_filename_cols - MAX_FILENAME_COLS + 1); else offset_cols = 0; offset_bytes = cols_to_bytes (bp->f_download, offset_cols, cols_ret); @@ -1159,7 +1155,7 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done) move_to_end (p); } - while (p - bp->buffer - bytes_cols_diff - size_grouped_diff < bp->width) + while (p - bp->buffer - bytes_cols_diff < bp->width) *p++ = ' '; *p = '\0'; }