From 9f88cb5044297003623fb63d47836c1167322417 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Sun, 14 Dec 2008 23:20:28 -0500 Subject: opkg: protect against total being zero when calculation percentage git-svn-id: http://opkg.googlecode.com/svn/trunk@23 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358 --- 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) -- cgit v0.9.1