From: Daniel Stenberg Date: Sun, 19 Jan 2025 10:27:53 +0000 (+0100) Subject: curl_multi_waitfds.md: tidy up the example X-Git-Tag: curl-8_12_0~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ce0bed1ff178092b66735c27dad7a2948bbcb03;p=thirdparty%2Fcurl.git curl_multi_waitfds.md: tidy up the example - remove typecast - shorten comment Closes #16050 --- diff --git a/docs/libcurl/curl_multi_waitfds.md b/docs/libcurl/curl_multi_waitfds.md index e1a333e060..7d828a4d7c 100644 --- a/docs/libcurl/curl_multi_waitfds.md +++ b/docs/libcurl/curl_multi_waitfds.md @@ -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);