diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-25 10:06:08 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-06-05 20:38:06 +0200 |
commit | e23c52b3295a525fbaae9e7ed3e7061fea6dffc2 (patch) | |
tree | 4a74cf5ed3496a6126f1cc7c4284b6620108db06 /packages/OS400/ccsidcurl.c | |
parent | 04ac54e1965041684fc1b6532eba90f58601264e (diff) | |
download | curl-e23c52b3295a525fbaae9e7ed3e7061fea6dffc2.tar.gz |
build: fix Codacy warnings
Reduce variable scopes and remove redundant variable stores.
Closes https://github.com/curl/curl/pull/3975
Diffstat (limited to 'packages/OS400/ccsidcurl.c')
-rw-r--r-- | packages/OS400/ccsidcurl.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index fd3b5f073..39a1f99b5 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -620,12 +620,7 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) va_list arg; void *paramp; CURLcode ret; - unsigned int ccsid; - char * * cpp; struct Curl_easy * data; - struct curl_slist * * slp; - struct curl_certinfo * cipf; - struct curl_certinfo * cipt; /* WARNING: unlike curl_easy_getinfo(), the strings returned by this procedure have to be free'ed. */ @@ -635,7 +630,13 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) paramp = va_arg(arg, void *); ret = Curl_getinfo(data, info, paramp); - if(ret == CURLE_OK) + if(ret == CURLE_OK) { + unsigned int ccsid; + char **cpp; + struct curl_slist **slp; + struct curl_certinfo *cipf; + struct curl_certinfo *cipt; + switch((int) info & CURLINFO_TYPEMASK) { case CURLINFO_STRING: @@ -706,6 +707,7 @@ curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...) break; } } + } va_end(arg); return ret; @@ -1355,13 +1357,12 @@ curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header, { char *d = (char *) NULL; - char *s; if(header) { header = dynconvert(ASCII_CCSID, header, -1, ccsidin); if(header) { - s = curl_pushheader_byname(h, header); + char *s = curl_pushheader_byname(h, header); free((char *) header); if(s) |