diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-02-11 09:42:38 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-02-11 09:44:45 +0100 |
commit | 3a6563d668406df1703edb4202afc038fcf9d30e (patch) | |
tree | 0fbb9438d99c13049f72b10c966583e582e4e238 /docs/examples/curlgtk.c | |
parent | 936d8f07dfbf2ac22ffd216f5363152bcecc2651 (diff) |
examples: adhere to curl code style
All plain C examples now (mostly) adhere to the curl code style. While
they are only examples, they had diverted so much and contained all
sorts of different mixed code styles by now. Having them use a unified
style helps users and readability. Also, as they get copy-and-pasted
widely by users, making sure they're clean and nice is a good idea.
573 checksrc warnings were addressed.
Diffstat (limited to 'docs/examples/curlgtk.c')
-rw-r--r-- | docs/examples/curlgtk.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/examples/curlgtk.c b/docs/examples/curlgtk.c index df6b419f2..c3129c198 100644 --- a/docs/examples/curlgtk.c +++ b/docs/examples/curlgtk.c @@ -50,9 +50,9 @@ void *my_thread(void *ptr) gchar *url = ptr; curl = curl_easy_init(); - if(curl) - { - outfile = fopen("test.curl", "w"); + if(curl) { + const char *filename = "test.curl"; + outfile = fopen(filename, "wb"); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile); @@ -97,7 +97,7 @@ int main(int argc, char **argv) gtk_container_add(GTK_CONTAINER(Frame2), Bar); gtk_widget_show_all(Window); - if (!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0) + if(!g_thread_create(&my_thread, argv[1], FALSE, NULL) != 0) g_warning("can't create the thread"); |