1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

anyauthput: fix compiler warning on 64-bit Windows

On Windows, the read function from <io.h> is used, which has its byte
count parameter as unsigned int instead of size_t.

Closes https://github.com/curl/curl/pull/2972
This commit is contained in:
Marcel Raad 2018-09-10 21:10:38 +02:00
parent 539a8059ef
commit 6a7feb103a
No known key found for this signature in database
GPG Key ID: 33C416EFAE4D6F02

View File

@ -26,16 +26,19 @@
*/
#include <stdio.h>
#include <fcntl.h>
#ifdef WIN32
# include <io.h>
#else
# include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <curl/curl.h>
#ifdef WIN32
# include <io.h>
# define READ_3RD_ARG unsigned int
#else
# include <unistd.h>
# define READ_3RD_ARG size_t
#endif
#if LIBCURL_VERSION_NUM < 0x070c03
#error "upgrade your libcurl to no less than 7.12.3"
#endif
@ -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;