From: Daniel Stenberg Date: Wed, 7 Jul 2021 08:14:35 +0000 (+0200) Subject: examples/multi-single: fix scan-build warning X-Git-Tag: curl-7_78_0~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1026b36ea07d385bd270d444ba65f4065839f1cb;p=thirdparty%2Fcurl.git examples/multi-single: fix scan-build warning warning: Value stored to 'mc' during its initialization is never read Follow-up to ae8e11ed5fd2ce Closes #7360 --- diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c index 272d4efe99..e340231fb9 100644 --- a/docs/examples/multi-single.c +++ b/docs/examples/multi-single.c @@ -68,11 +68,12 @@ int main(void) do { CURLMcode mc = curl_multi_perform(multi_handle, &still_running); - /* wait for activity, timeout or "nothing" */ - mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); + if(!mc) + /* wait for activity, timeout or "nothing" */ + mc = curl_multi_poll(multi_handle, NULL, 0, 1000, NULL); - if(mc != CURLM_OK) { - fprintf(stderr, "curl_multi_wait() failed, code %d.\n", mc); + if(mc) { + fprintf(stderr, "curl_multi_poll() failed, code %d.\n", (int)mc); break; }