From fb3b0f25ef9b20b40e48d2a507968a975ef09bb9 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Sun, 16 Jul 2017 13:44:54 +0200 Subject: libtest: fix MSVC warning C4706 With warning level 4, MSVC warns about assignments within conditional expressions. Change the while loop to a do-while loop to fix this. This change is also consistent with CODE_STYLE.md. --- tests/libtest/lib1531.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/libtest/lib1531.c') diff --git a/tests/libtest/lib1531.c b/tests/libtest/lib1531.c index e6386b264..287acd6c6 100644 --- a/tests/libtest/lib1531.c +++ b/tests/libtest/lib1531.c @@ -127,12 +127,13 @@ int test(char *URL) } while(still_running); /* See how the transfers went */ - while((msg = curl_multi_info_read(multi_handle, &msgs_left))) { - if(msg->msg == CURLMSG_DONE) { + do { + msg = curl_multi_info_read(multi_handle, &msgs_left); + if(msg && msg->msg == CURLMSG_DONE) { printf("HTTP transfer completed with status %d\n", msg->data.result); break; } - } + } while(msg); curl_multi_cleanup(multi_handle); -- cgit v1.2.3