From: Marcel Raad Date: Mon, 10 Sep 2018 19:10:38 +0000 (+0200) Subject: anyauthput: fix compiler warning on 64-bit Windows X-Git-Tag: curl-7_62_0~195 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a7feb103af4a03f79bc64410be738c2be7aa1d6;p=curl anyauthput: fix compiler warning on 64-bit Windows On Windows, the read function from is used, which has its byte count parameter as unsigned int instead of size_t. Closes https://github.com/curl/curl/pull/2972 --- diff --git a/docs/examples/anyauthput.c b/docs/examples/anyauthput.c index eb91d991b..14da10c3b 100644 --- a/docs/examples/anyauthput.c +++ b/docs/examples/anyauthput.c @@ -26,15 +26,18 @@ */ #include #include +#include +#include + +#include + #ifdef WIN32 # include +# define READ_3RD_ARG unsigned int #else # include +# define READ_3RD_ARG size_t #endif -#include -#include - -#include #if LIBCURL_VERSION_NUM < 0x070c03 #error "upgrade your libcurl to no less than 7.12.3" @@ -83,7 +86,7 @@ static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) int *fdp = (int *)stream; int fd = *fdp; - retcode = read(fd, ptr, size * nmemb); + retcode = read(fd, ptr, (READ_3RD_ARG)(size * nmemb)); nread = (curl_off_t)retcode;