Skip to content
Snippets Groups Projects
Commit aadc7972 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

quickfix to avoid division by zero, possibly we should go over all of these

once and for all
parent 5c882bdf
No related branches found
No related tags found
No related merge requests found
......@@ -362,7 +362,8 @@ int Curl_pgrsUpdate(struct connectdata *conn)
/* Figure out the estimated time of arrival for the upload */
if((data->progress.flags & PGRS_UL_SIZE_KNOWN) &&
(data->progress.ulspeed > 100)) {
(data->progress.ulspeed>0) &&
(data->progress.size_ul > 100) ) {
ulestimate = (long)(data->progress.size_ul / data->progress.ulspeed);
ulpercen = (long)(100*(data->progress.uploaded/100) /
(data->progress.size_ul/100) );
......@@ -370,7 +371,8 @@ int Curl_pgrsUpdate(struct connectdata *conn)
/* ... and the download */
if((data->progress.flags & PGRS_DL_SIZE_KNOWN) &&
(data->progress.dlspeed > 100)) {
(data->progress.dlspeed>0) &&
(data->progress.size_dl>100)) {
dlestimate = (long)(data->progress.size_dl / data->progress.dlspeed);
dlpercen = (long)(100*(data->progress.downloaded/100) /
(data->progress.size_dl/100));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment