examples: reduce variable scopes

Closes https://github.com/curl/curl/pull/3919
This commit is contained in:
Marcel Raad 2019-05-21 10:44:16 +02:00
parent 918987a844
commit 10b7067eb7
No known key found for this signature in database
GPG key ID: 33C416EFAE4D6F02
11 changed files with 51 additions and 51 deletions

View file

@ -67,13 +67,12 @@ size_t write_file(void *ptr, size_t size, size_t nmemb, FILE *stream)
/* https://weather.com/weather/today/l/46214?cc=*&dayf=5&unit=i */
void *pull_one_url(void *NaN)
{
CURL *curl;
gchar *http;
FILE *outfile;
/* Stop threads from entering unless j is incremented */
pthread_mutex_lock(&lock);
while(j < num_urls) {
CURL *curl;
gchar *http;
printf("j = %d\n", j);
http =
@ -85,7 +84,7 @@ void *pull_one_url(void *NaN)
curl = curl_easy_init();
if(curl) {
outfile = fopen(urls[j], "wb");
FILE *outfile = fopen(urls[j], "wb");
/* Set the URL and transfer type */
curl_easy_setopt(curl, CURLOPT_URL, http);