]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
no percentage on readsize == 0 2068/head
authorBimba Shrestha <bimbashrestha@fb.com>
Fri, 3 Apr 2020 19:10:02 +0000 (12:10 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Fri, 3 Apr 2020 19:10:02 +0000 (12:10 -0700)
programs/fileio.c

index 6dd99f0fe358ee9a963fbc36db956bd3f49ae933..f2ae1bd44bb7f3793aaf3b9bba3b2b742dce0058 100644 (file)
@@ -1387,11 +1387,18 @@ FIO_compressFilename_internal(FIO_prefs_t* const prefs,
 
     /* Status */
     DISPLAYLEVEL(2, "\r%79s\r", "");
-    DISPLAYLEVEL(2,"%-20s :%6.2f%%   (%6llu => %6llu bytes, %s) \n",
-        srcFileName,
-        (double)compressedfilesize / readsize * 100,
-        (unsigned long long)readsize, (unsigned long long) compressedfilesize,
-         dstFileName);
+    if (readsize == 0) {
+        DISPLAYLEVEL(2,"%-20s :  (%6llu => %6llu bytes, %s) \n",
+            srcFileName,
+            (unsigned long long)readsize, (unsigned long long) compressedfilesize,
+            dstFileName);
+    } else {
+        DISPLAYLEVEL(2,"%-20s :%6.2f%%   (%6llu => %6llu bytes, %s) \n",
+            srcFileName,
+            (double)compressedfilesize / readsize * 100,
+            (unsigned long long)readsize, (unsigned long long) compressedfilesize,
+            dstFileName);
+    }
 
     /* Elapsed Time and CPU Load */
     {   clock_t const cpuEnd = clock();