diff options
author | Brad King <brad.king@kitware.com> | 2021-09-15 19:28:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-15 19:28:38 (GMT) |
commit | 8ecd95845cf0254259cd19a0550beafe83131708 (patch) | |
tree | 6983d7d95f0c7be15b33cf7953c3a9ebc9f815b8 /Utilities/cmcurl/lib/progress.c | |
parent | a8ae9c7055fc5d7175a3082640733745248b4274 (diff) | |
parent | 386467c9dc939cd20711c451dd7d60341fd0e802 (diff) | |
download | CMake-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.c | 7 |
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 */ |