diff --git a/lib/copy_file.c b/lib/copy_file.c index 967806c..484b2ca 100644 --- a/lib/copy_file.c +++ b/lib/copy_file.c @@ -21,6 +21,7 @@ int ret = 1; void *buf; int total = 0; + struct stat statbuf; rw_buf = xmalloc(RW_BUF_SIZE); @@ -37,8 +38,6 @@ } if (verbose) { - struct stat statbuf; - if (stat(src, &statbuf) < 0) statbuf.st_size = 0; @@ -67,7 +66,7 @@ } if (verbose) - show_progress(total); + show_progress(statbuf.st_size ? total : total / 16384); } ret = 0;