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:
Daniel Stenberg 2023-11-21 08:13:08 +01:00
parent 1cd2f0072f
commit 891f1041d6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;
}