Skip to content

Commit ddf7b95

Browse files
committed
utils: report 0% when DL size is 0/unset
1 parent 9886d5c commit ddf7b95

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/Utils.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,15 @@ static int libget_curl_progress_wrapper(void* /*clientp*/, double dltotal, doubl
7474
return 0;
7575

7676
if (dltotal == 0)
77-
dltotal = 1;
77+
return networking_callback(networking_callback_data, 0.0);
7878

7979
double progress = (double)dlnow / (double)dltotal;
80+
81+
// don't go OOB
82+
if (progress > 1.0) {
83+
progress = 1.0;
84+
}
85+
8086
return networking_callback(networking_callback_data, progress);
8187
}
8288
#endif

src/libs/minizip/zip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in
14741474
if(uTotalOutBefore > zi->ci.stream.total_out)
14751475
{
14761476
int bBreak = 0;
1477+
(void) bBreak;
14771478
bBreak++;
14781479
}
14791480

0 commit comments

Comments
 (0)