From 10b7067eb722bf2bc19f4dd6d97199be705baea2 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Tue, 21 May 2019 10:44:16 +0200 Subject: examples: reduce variable scopes Closes https://github.com/curl/curl/pull/3919 --- docs/examples/shared-connection-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/examples/shared-connection-cache.c') diff --git a/docs/examples/shared-connection-cache.c b/docs/examples/shared-connection-cache.c index 91864d9b2..639ad9c54 100644 --- a/docs/examples/shared-connection-cache.c +++ b/docs/examples/shared-connection-cache.c @@ -46,8 +46,6 @@ static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) int main(void) { - CURL *curl; - CURLcode res; CURLSH *share; int i; @@ -61,8 +59,10 @@ int main(void) still reuse connections since the pool is in the shared object! */ for(i = 0; i < 3; i++) { - curl = curl_easy_init(); + CURL *curl = curl_easy_init(); if(curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, "https://curl.haxx.se/"); /* use the share object */ -- cgit v1.2.3