]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
examples/multi-single: fix scan-build warning
authorDaniel Stenberg <daniel@haxx.se>
Wed, 7 Jul 2021 08:14:35 +0000 (10:14 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 7 Jul 2021 11:06:18 +0000 (13:06 +0200)
warning: Value stored to 'mc' during its initialization is never read

Follow-up to ae8e11ed5fd2ce

Closes #7360

docs/examples/multi-single.c

index 272d4efe99896b2e8a372a2c96c9d0b1450d7561..e340231fb904e84971e56f97bf7494d52da9c821 100644 (file)
@@ -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;
     }