diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-21 10:44:16 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-05-22 10:06:21 +0200 |
commit | 10b7067eb722bf2bc19f4dd6d97199be705baea2 (patch) | |
tree | d6a5e6ff76b923997ab6f859ac3d1015e9c30f81 /docs/examples/curlgtk.c | |
parent | 918987a844912b431f132b5c4d49fb73a0cb1a0e (diff) | |
download | curl-10b7067eb722bf2bc19f4dd6d97199be705baea2.tar.gz |
examples: reduce variable scopes
Closes https://github.com/curl/curl/pull/3919
Diffstat (limited to 'docs/examples/curlgtk.c')
-rw-r--r-- | docs/examples/curlgtk.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/docs/examples/curlgtk.c b/docs/examples/curlgtk.c index 35b60da63..4083c8f95 100644 --- a/docs/examples/curlgtk.c +++ b/docs/examples/curlgtk.c @@ -45,13 +45,12 @@ int my_progress_func(GtkWidget *bar, void *my_thread(void *ptr) { CURL *curl; - FILE *outfile; - gchar *url = ptr; curl = curl_easy_init(); if(curl) { + gchar *url = ptr; const char *filename = "test.curl"; - outfile = fopen(filename, "wb"); + FILE *outfile = fopen(filename, "wb"); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); |