From: ticktock35 Date: Mon, 15 Dec 2008 04:20:28 +0000 (+0000) Subject: opkg: protect against total being zero when calculation percentage X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9f88cb5044297003623fb63d47836c1167322417;p=oweals%2Fopkg-lede.git 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)