r3972 - trunk/src/target/opkg

thomas at sita.openmoko.org thomas at sita.openmoko.org
Tue Jan 29 12:58:16 CET 2008


Author: thomas
Date: 2008-01-29 12:58:15 +0100 (Tue, 29 Jan 2008)
New Revision: 3972

Modified:
   trunk/src/target/opkg/opkg_download.c
Log:
opkg: protect against total being zero when calculation percentage


Modified: trunk/src/target/opkg/opkg_download.c
===================================================================
--- trunk/src/target/opkg/opkg_download.c	2008-01-29 09:10:44 UTC (rev 3971)
+++ trunk/src/target/opkg/opkg_download.c	2008-01-29 11:58:15 UTC (rev 3972)
@@ -42,7 +42,7 @@
 		    double ulnow)
 {
     int i;
-    int p = d*100/t;
+    int p = (t) ? d*100/t : 0;
 
 #ifdef OPKG_LIB
     if (opkg_cb_download_progress)





More information about the commitlog mailing list