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/multi-app.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'docs/examples/multi-app.c') diff --git a/docs/examples/multi-app.c b/docs/examples/multi-app.c index 421b8f4a9..f8447930a 100644 --- a/docs/examples/multi-app.c +++ b/docs/examples/multi-app.c @@ -55,8 +55,8 @@ int main(void) int msgs_left; /* how many messages are left */ /* Allocate one CURL handle per transfer */ - for (i=0; imsg == CURLMSG_DONE) { + while((msg = curl_multi_info_read(multi_handle, &msgs_left))) { + if(msg->msg == CURLMSG_DONE) { int idx, found = 0; /* Find out which handle this message is about */ - for (idx=0; idxeasy_handle == handles[idx]); if(found) break; @@ -171,8 +170,8 @@ int main(void) curl_multi_cleanup(multi_handle); /* Free the CURL handles */ - for (i=0; i