setopt: add helper functions to setopt_long()

- Consistently keep options within ranges
- Reduce the maximum maxredirs value to fit a signed short
- Removed comments as the place to document the options is not here

Closes #18174
This commit is contained in:
Daniel Stenberg 2025-08-05 08:47:31 +02:00
parent b5d2e6e63f
commit b059f7deaf
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 51 additions and 216 deletions

View file

@ -1323,7 +1323,7 @@ CURLcode Curl_http_follow(struct Curl_easy *data, const char *newurl,
data->info.wouldredirect = follow_url;
if(reachedmax) {
failf(data, "Maximum (%ld) redirects followed", data->set.maxredirs);
failf(data, "Maximum (%d) redirects followed", data->set.maxredirs);
return CURLE_TOO_MANY_REDIRECTS;
}
return CURLE_OK;