From: Daniel Stenberg Date: Tue, 13 May 2025 09:25:43 +0000 (+0200) Subject: setopt: provide info for CURLE_BAD_FUNCTION_ARGUMENT X-Git-Tag: curl-8_14_0~90 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cce66b3b3a2f5c2523a758498412a02b67a1224;p=thirdparty%2Fcurl.git setopt: provide info for CURLE_BAD_FUNCTION_ARGUMENT If CURLE_BAD_FUNCTION_ARGUMENT is returned and failf() has not provided any details, this adds a generic error string that includes the option number. This helps debugging for example the curl tool which does a lot of setopt calls and in reading post fact logs it is not always easy to tell exactly which call that failed. Closes #17337 --- diff --git a/lib/setopt.c b/lib/setopt.c index aa8043dc96..885fa8e75d 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -3070,9 +3070,7 @@ CURLcode curl_easy_setopt(CURL *d, CURLoption tag, ...) result = Curl_vsetopt(data, tag, arg); va_end(arg); -#ifdef DEBUGBUILD if(result == CURLE_BAD_FUNCTION_ARGUMENT) - infof(data, "setopt arg 0x%x returned CURLE_BAD_FUNCTION_ARGUMENT", tag); -#endif + failf(data, "setopt 0x%x got bad argument", tag); return result; }