mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
Fix integer overflow in percentage calculation, credits: Peter Slegg.
This commit is contained in:
parent
2437ca84a8
commit
4fbeacf830
@ -265,7 +265,7 @@ nserror gui_download_window_data(struct gui_download_window *dw,
|
||||
dw->lastrdw = tnow;
|
||||
tree = ObjcTree(OC_FORM, dw->form );
|
||||
if( dw->size_total > 0 ){
|
||||
p = (dw->size_downloaded *100) / dw->size_total;
|
||||
p = ((double)dw->size_downloaded / (double)dw->size_total * 100);
|
||||
}
|
||||
speed = dw->size_downloaded / sdiff;
|
||||
tree[DOWNLOAD_PROGRESS_DONE].ob_width = MAX( MIN( p*(DOWNLOAD_BAR_MAX/100), DOWNLOAD_BAR_MAX ), 1);
|
||||
|
Loading…
Reference in New Issue
Block a user