mirror of
https://github.com/curl/curl.git
synced 2025-09-14 08:02:44 +03:00
transfer: avoid unreachable expression
If curl_off_t and size_t have the same size (which is common on modern
64 bit systems), a condition cannot occur which Coverity pointed
out. Avoid the warning by having the code conditionally only used if
curl_off_t actually is larger.
Follow-up to 1cd2f0072f
Closes #12370
This commit is contained in:
parent
1cd2f0072f
commit
891f1041d6
|
@ -423,9 +423,11 @@ static size_t get_max_body_write_len(struct Curl_easy *data)
|
|||
/* already written too much! */
|
||||
return 0;
|
||||
}
|
||||
#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T
|
||||
else if(remain_diff > SSIZE_T_MAX) {
|
||||
return SIZE_T_MAX;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
return (size_t)remain_diff;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user