opkg: protect against total being zero when calculation percentage
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:20:28 +0000 (04:20 +0000)
committerticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 15 Dec 2008 04:20:28 +0000 (04:20 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@23 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

opkg_download.c

index 161a5100363e917f8c92e3b0ec168ec29b106096..c3fa44cc209a38adc9c0a12ff8da812c636eb235 100644 (file)
@@ -42,7 +42,7 @@ curl_progress_func (char* url,
                    double ulnow)
 {
     int i;
-    int p = d*100/t;
+    int p = (t) ? d*100/t : 0;
 
 #ifdef OPKG_LIB
     if (opkg_cb_download_progress)