diff --git a/lib/copy_file.c b/lib/copy_file.c index ab3d845..55dee38 100644 --- a/lib/copy_file.c +++ b/lib/copy_file.c @@ -63,8 +63,12 @@ total += w; } - if (verbose) - show_progress(statbuf.st_size ? total : total / 16384); + if (verbose) { + if (statbuf.st_size && statbuf.st_size != FILESIZE_MAX) + show_progress(total); + else + show_progress(total / 16384); + } } ret = 0; diff --git a/lib/show_progress.c b/lib/show_progress.c index bc067ea..98dc849 100644 --- a/lib/show_progress.c +++ b/lib/show_progress.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -37,7 +38,7 @@ return; } - if (progress_max) { + if (progress_max && progress_max != FILESIZE_MAX) { uint64_t tmp = (int64_t)now * HASHES_PER_LINE; do_div(tmp, progress_max); now = tmp; @@ -56,7 +57,7 @@ printed = 0; progress_max = max; spin = 0; - if (progress_max) + if (progress_max && progress_max != FILESIZE_MAX) printf("\t[%"__stringify(HASHES_PER_LINE)"s]\r\t[", ""); else printf("\t");