summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:20:28 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:20:28 (EST)
commit9f88cb5044297003623fb63d47836c1167322417 (patch)
treebeefb53f9c5dfeec5f3b642e1f7a4b1ad5c88bf8
parent0a94bb14c9cfed746d645a35872fc9daa308ab5d (diff)
opkg: protect against total being zero when calculation percentage
git-svn-id: http://opkg.googlecode.com/svn/trunk@23 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--opkg_download.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opkg_download.c b/opkg_download.c
index 161a510..c3fa44c 100644
--- a/opkg_download.c
+++ b/opkg_download.c
@@ -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)