summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/progress.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-09-15 19:28:38 (GMT)
committerBrad King <brad.king@kitware.com>2021-09-15 19:28:38 (GMT)
commit8ecd95845cf0254259cd19a0550beafe83131708 (patch)
tree6983d7d95f0c7be15b33cf7953c3a9ebc9f815b8 /Utilities/cmcurl/lib/progress.c
parenta8ae9c7055fc5d7175a3082640733745248b4274 (diff)
parent386467c9dc939cd20711c451dd7d60341fd0e802 (diff)
downloadCMake-8ecd95845cf0254259cd19a0550beafe83131708.zip
CMake-8ecd95845cf0254259cd19a0550beafe83131708.tar.gz
CMake-8ecd95845cf0254259cd19a0550beafe83131708.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2021-09-14 (8e82f2a0)
Diffstat (limited to 'Utilities/cmcurl/lib/progress.c')
-rw-r--r--Utilities/cmcurl/lib/progress.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Utilities/cmcurl/lib/progress.c b/Utilities/cmcurl/lib/progress.c
index 4bcd615..f5ef6bd 100644
--- a/Utilities/cmcurl/lib/progress.c
+++ b/Utilities/cmcurl/lib/progress.c
@@ -377,7 +377,12 @@ static curl_off_t trspeed(curl_off_t size, /* number of bytes */
{
if(us < 1)
return size * 1000000;
- return (curl_off_t)((long double)size/us * 1000000);
+ else if(size < CURL_OFF_T_MAX/1000000)
+ return (size * 1000000) / us;
+ else if(us >= 1000000)
+ return size / (us / 1000000);
+ else
+ return CURL_OFF_T_MAX;
}
/* returns TRUE if it's time to show the progress meter */