]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
curl_multi_waitfds.md: tidy up the example
authorDaniel Stenberg <daniel@haxx.se>
Sun, 19 Jan 2025 10:27:53 +0000 (11:27 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 19 Jan 2025 10:45:25 +0000 (11:45 +0100)
- remove typecast
- shorten comment

Closes #16050

docs/libcurl/curl_multi_waitfds.md

index e1a333e060abb7df34e1eda32e47d23088771ecd..7d828a4d7c05b45de91d79dc2814f9869fb7f28e 100644 (file)
@@ -83,11 +83,8 @@ int main(void)
     if(!fd_count)
       continue; /* no descriptors yet */
 
-    /* Allocate storage for our descriptors.
-    * Note that a better approach can be used to minimize allocations and
-    * deallocations, if needed, like pre-allocated or grow-only array.
-    */
-    ufds = (struct curl_waitfd*)malloc(fd_count * sizeof(struct curl_waitfd));
+    /* allocate storage for our descriptors */
+    ufds = malloc(fd_count * sizeof(struct curl_waitfd));
 
     /* get wait descriptors from the transfers and put them into array. */
     mc = curl_multi_waitfds(multi, ufds, fd_count, &fd_count);