summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/progress.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2021-11-16 22:24:39 +0300
committerdartraiden <wowemuh@gmail.com>2021-11-16 22:26:13 +0300
commit53a0928794b1b7f3e9bbb7c09d939d32378379d6 (patch)
tree00b4b965972b4133dd56fcaa1e80b5c330687837 /libs/libcurl/src/progress.c
parentaa3402bb65378066b00862547ebe7b6ce5c821c6 (diff)
libcurl: update to 7.80.0
Diffstat (limited to 'libs/libcurl/src/progress.c')
-rw-r--r--libs/libcurl/src/progress.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/libcurl/src/progress.c b/libs/libcurl/src/progress.c
index 4bcd615eba..f5ef6bd526 100644
--- a/libs/libcurl/src/progress.c
+++ b/libs/libcurl/src/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 */