setopt: make CURLOPT_MAXREDIRS accept -1 (again)

Regression from b059f7d (shipped in 8.16.0)

Reported-by: Adam Light
Fixes #18571
Closes #18576
This commit is contained in:
Daniel Stenberg 2025-09-17 08:25:42 +02:00
parent 3053a3e90f
commit 9236199908
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -955,7 +955,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option,
break;
case CURLOPT_MAXREDIRS:
result = value_range(&arg, -1, 0, 0x7fff);
result = value_range(&arg, -1, -1, 0x7fff);
if(result)
return result;
s->maxredirs = (short)arg;