mirror of
https://github.com/mirror/wget.git
synced 2025-03-09 17:20:33 +08:00
* src/retr.c (calc_rate): Fix division by 0
This commit is contained in:
parent
1c1cba3a43
commit
f5d1dcf718
@ -826,7 +826,7 @@ calc_rate (wgint bytes, double secs, int *units)
|
||||
0 and the timer's resolution, assume half the resolution. */
|
||||
secs = ptimer_resolution () / 2.0;
|
||||
|
||||
dlrate = convert_to_bits (bytes) / secs;
|
||||
dlrate = secs ? convert_to_bits (bytes) / secs : 0;
|
||||
if (dlrate < bibyte)
|
||||
*units = 0;
|
||||
else if (dlrate < (bibyte * bibyte))
|
||||
|
Loading…
Reference in New Issue
Block a user