From 3a6563d668406df1703edb4202afc038fcf9d30e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Feb 2016 09:42:38 +0100 Subject: 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. --- docs/examples/curlgtk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/examples/curlgtk.c') 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"); -- cgit v1.2.3