mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
curl: fix callback argument inconsistency
As you can see the callback definition uses a char* for the first argument, while the function uses a void*. URL: https://curl.haxx.se/mail/lib-2017-03/0116.html
This commit is contained in:
parent
396f34250d
commit
aced311d18
@ -40,7 +40,7 @@ static char *parse_filename(const char *ptr, size_t len);
|
||||
** callback for CURLOPT_HEADERFUNCTION
|
||||
*/
|
||||
|
||||
size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata)
|
||||
size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
||||
{
|
||||
struct HdrCbData *hdrcbdata = userdata;
|
||||
struct OutStruct *outs = hdrcbdata->outs;
|
||||
|
@ -48,7 +48,7 @@ struct HdrCbData {
|
||||
** callback for CURLOPT_HEADERFUNCTION
|
||||
*/
|
||||
|
||||
size_t tool_header_cb(void *ptr, size_t size, size_t nmemb, void *userdata);
|
||||
size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata);
|
||||
|
||||
#endif /* HEADER_CURL_TOOL_CB_HDR_H */
|
||||
|
||||
|
@ -72,7 +72,7 @@ bool tool_create_output_file(struct OutStruct *outs)
|
||||
** callback for CURLOPT_WRITEFUNCTION
|
||||
*/
|
||||
|
||||
size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata)
|
||||
size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
||||
{
|
||||
size_t rc;
|
||||
struct OutStruct *outs = userdata;
|
||||
|
@ -27,7 +27,7 @@
|
||||
** callback for CURLOPT_WRITEFUNCTION
|
||||
*/
|
||||
|
||||
size_t tool_write_cb(void *buffer, size_t sz, size_t nmemb, void *userdata);
|
||||
size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata);
|
||||
|
||||
/* create a local file for writing, return TRUE on success */
|
||||
bool tool_create_output_file(struct OutStruct *outs);
|
||||
|
Loading…
Reference in New Issue
Block a user