Skip to content

Commit

Permalink
warning: silence a win64 compiler warning
Browse files Browse the repository at this point in the history
conversion from 'size_t' to 'curl_socklen_t', possible loss of data

Reported by: Adam Light
  • Loading branch information
bagder committed Jul 30, 2010
1 parent 53e47ca commit 2f0c118
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/curl_addrinfo.c
Expand Up @@ -151,7 +151,10 @@ Curl_getaddrinfo_ex(const char *nodename,
ca->ai_next = NULL;

if((ai->ai_addrlen > 0) && (ai->ai_addr != NULL)) {
ca->ai_addrlen = ai->ai_addrlen;
/* typecast below avoid warning on at least win64:
conversion from 'size_t' to 'curl_socklen_t', possible loss of data
*/
ca->ai_addrlen = (curl_socklen_t)ai->ai_addrlen;
if((ca->ai_addr = malloc(ca->ai_addrlen)) == NULL) {
error = EAI_MEMORY;
free(ca);
Expand Down

0 comments on commit 2f0c118

Please sign in to comment.