diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-11 21:42:48 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-20 08:51:11 +0200 |
commit | 10db3ef21eef1c7a1727579952a81ced2f4afc8b (patch) | |
tree | 57129a847b5913959063a60290201b1f52482fee /lib/hostip6.c | |
parent | 27af2ec219244bef24e6d11649d41aad3668da45 (diff) | |
download | curl-10db3ef21eef1c7a1727579952a81ced2f4afc8b.tar.gz |
lib: reduce variable scopes
Fixes Codacy/CppCheck warnings.
Closes https://github.com/curl/curl/pull/3872
Diffstat (limited to 'lib/hostip6.c')
-rw-r--r-- | lib/hostip6.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/hostip6.c b/lib/hostip6.c index fb2f35ce3..5511f1aab 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -102,14 +102,15 @@ static void dump_addrinfo(struct connectdata *conn, const Curl_addrinfo *ai) printf("dump_addrinfo:\n"); for(; ai; ai = ai->ai_next) { char buf[INET6_ADDRSTRLEN]; - char buffer[STRERROR_LEN]; printf(" fam %2d, CNAME %s, ", ai->ai_family, ai->ai_canonname ? ai->ai_canonname : "<none>"); if(Curl_printable_address(ai, buf, sizeof(buf))) printf("%s\n", buf); - else + else { + char buffer[STRERROR_LEN]; printf("failed; %s\n", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer))); + } } } #else |