From ef8d98bbbab0ca083aa179bd595aab39019ec8de Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Sun, 16 Jun 2019 01:05:53 +0200 Subject: [PATCH] os400: make vsetopt() non-static as Curl_vsetopt() for os400 support. Use it in curl_easy_setopt_ccsid(). Reported-by: jonrumsey on github Fixes #3833 Closes #4028 --- lib/setopt.c | 9 ++++++--- lib/setopt.h | 5 ++--- packages/OS400/ccsidcurl.c | 5 +---- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index 92cd5b271..bdfe86ac7 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -119,8 +119,11 @@ static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp) #define C_SSLVERSION_VALUE(x) (x & 0xffff) #define C_SSLVERSION_MAX_VALUE(x) (x & 0xffff0000) -static CURLcode vsetopt(struct Curl_easy *data, CURLoption option, - va_list param) +/* + * Do not make Curl_vsetopt() static: it is called from + * packages/OS400/ccsidcurl.c. + */ +CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) { char *argptr; CURLcode result = CURLE_OK; @@ -2770,7 +2773,7 @@ CURLcode curl_easy_setopt(struct Curl_easy *data, CURLoption tag, ...) va_start(arg, tag); - result = vsetopt(data, tag, arg); + result = Curl_vsetopt(data, tag, arg); va_end(arg); return result; diff --git a/lib/setopt.h b/lib/setopt.h index c658e04ae..5e347dd66 100644 --- a/lib/setopt.h +++ b/lib/setopt.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -23,7 +23,6 @@ ***************************************************************************/ CURLcode Curl_setstropt(char **charp, const char *s); -CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, - va_list arg); +CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list arg); #endif /* HEADER_CURL_SETOPT_H */ diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index 39a1f99b5..4b462a273 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -1314,12 +1314,9 @@ curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...) case CURLOPT_ERRORBUFFER: /* This is an output buffer. */ default: - { - long val = va_arg(arg, long); - result = curl_easy_setopt(curl, tag, val); + result = Curl_vsetopt(curl, tag, arg); break; } - } va_end(arg); return result;