aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/curlgtk.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-21 10:44:16 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-22 10:06:21 +0200
commit10b7067eb722bf2bc19f4dd6d97199be705baea2 (patch)
treed6a5e6ff76b923997ab6f859ac3d1015e9c30f81 /docs/examples/curlgtk.c
parent918987a844912b431f132b5c4d49fb73a0cb1a0e (diff)
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.c5
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);