Skip to content
Permalink
Browse files
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
  • Loading branch information
hannob authored and bagder committed Mar 29, 2017
1 parent 396f342 commit aced311d189a70c7d9b2d958739bcfc1231b3698
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
@@ -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);

0 comments on commit aced311

Please sign in to comment.