diff options
-rw-r--r-- | lib/progress.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/progress.c b/lib/progress.c index 62e61d45b..f5ef6bd52 100644 --- a/lib/progress.c +++ b/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/(long double)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 */ |