From 566e2a18de19e029acca1f02666cd119ed62a0a8 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 9 Sep 2015 22:32:12 +0100 Subject: [PATCH] Fix wonky va_list usage --- code/client/cl_curl.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c index 3519de06..4761a115 100644 --- a/code/client/cl_curl.c +++ b/code/client/cl_curl.c @@ -217,14 +217,11 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t size, size_t nmemb, return size*nmemb; } -CURLcode qcurl_easy_setopt_warn(CURL *curl, CURLoption option, ...) +static CURLcode qcurl_easy_setopt_warn_valist(CURL *curl, CURLoption option, va_list args) { CURLcode result; - va_list args; - va_start(args, option); result = qcurl_easy_setopt(curl, option, args); - va_end(args); if(result != CURLE_OK) { Com_DPrintf("qcurl_easy_setopt failed: %s\n", qcurl_easy_strerror(result)); } @@ -232,6 +229,18 @@ CURLcode qcurl_easy_setopt_warn(CURL *curl, CURLoption option, ...) return result; } +CURLcode qcurl_easy_setopt_warn(CURL *curl, CURLoption option, ...) +{ + CURLcode result; + + va_list argp; + va_start(argp, option); + result = qcurl_easy_setopt_warn_valist(curl, option, argp); + va_end(argp); + + return result; +} + void CL_cURL_BeginDownload( const char *localName, const char *remoteURL ) { CURLMcode result;