eio: let's not divide by 0.
authorCedric BAIL <cedric.bail@samsung.com>
Thu, 20 Mar 2014 07:47:25 +0000 (16:47 +0900)
committerCedric BAIL <cedric.bail@samsung.com>
Thu, 20 Mar 2014 07:47:25 +0000 (16:47 +0900)
fix CID 1193208.

src/lib/eio/eio_main.c

index 632d02256edf272680d5661e6b35666bd9ae136c..812437da4c353dfad1f08a69c5ea3c4b07321048 100644 (file)
@@ -149,7 +149,7 @@ eio_progress_send(Ecore_Thread *thread, Eio_File_Progress *op, long long current
    progress->op = op->op;
    progress->current = current;
    progress->max = max;
-   progress->percent = (float) current * 100.0 / (float) max;
+   progress->percent = max ? (float) current * 100.0 / (float) max : 100;
    progress->source = eina_stringshare_ref(op->source);
    progress->dest = eina_stringshare_ref(op->dest);