mirror of
https://github.com/curl/curl.git
synced 2026-07-02 18:47:16 +03:00
tool_progress: avoid division by zero in parallel progress meter
Reported-by: Brian Carpenter Fixes #9082 Closes #9083
This commit is contained in:
parent
4d4c2274d0
commit
0defae2fe5
1 changed files with 2 additions and 0 deletions
|
|
@ -268,6 +268,8 @@ bool progress_meter(struct GlobalConfig *global,
|
|||
dl = all_dlnow;
|
||||
ul = all_ulnow;
|
||||
}
|
||||
if(!deltams) /* no division by zero please */
|
||||
deltams++;
|
||||
dls = (curl_off_t)((double)dl / ((double)deltams/1000.0));
|
||||
uls = (curl_off_t)((double)ul / ((double)deltams/1000.0));
|
||||
speed = dls > uls ? dls : uls;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue