mirror of
https://github.com/curl/curl.git
synced 2026-08-24 14:03:35 +03:00
examples: reduce variable scopes
Closes https://github.com/curl/curl/pull/3919
This commit is contained in:
parent
918987a844
commit
10b7067eb7
11 changed files with 51 additions and 51 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue