edje_cc out: fix div by 0 correctly
authorAmitesh Singh <amitesh.sh@samsung.com>
Mon, 24 Jul 2017 00:50:05 +0000 (09:50 +0900)
committerAmitesh Singh <amitesh.sh@samsung.com>
Mon, 24 Jul 2017 00:50:05 +0000 (09:50 +0900)
src/bin/edje/edje_cc_out.c

index 1f4315c..99f46bf 100644 (file)
@@ -2529,7 +2529,7 @@ data_thread_license(void *data, Ecore_Thread *thread EINA_UNUSED)
      {
         double fsize = eina_file_size_get(f);
 
-        if (fsize < 0.0) fsize = 0.0;
+        if (fsize <= 0.0) fsize = 1.0;
         INF("Wrote %9i bytes (%4iKb) for \"%s\" license entry compress: [real: %2.1f%%]",
             bytes, (bytes + 512) / 1024, license,
             100.0 - ((100.0 * (double)bytes) / fsize));
@@ -2617,7 +2617,7 @@ data_thread_authors(void *data, Ecore_Thread *thread EINA_UNUSED)
      {
         double fsize = eina_file_size_get(f);
 
-        if (fsize < 0.0) fsize = 0.0;
+        if (fsize <= 0.0) fsize = 1.0;
         INF("Wrote %9i bytes (%4iKb) for \"%s\" authors entry compress: [real: %2.1f%%]",
             bytes, (bytes + 512) / 1024, license,
             100.0 - ((100.0 * (double)bytes) / fsize));