mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
unit1305: fix compiler warning
calloc and ai_addrlen expect different (usually unsigned) types.
This commit is contained in:
parent
1ef38a95d2
commit
ad8c1472fe
@ -76,9 +76,6 @@ static void unit_stop(void)
|
||||
static Curl_addrinfo *fake_ai(void)
|
||||
{
|
||||
static Curl_addrinfo *ai;
|
||||
int ss_size;
|
||||
|
||||
ss_size = sizeof(struct sockaddr_in);
|
||||
|
||||
ai = calloc(1, sizeof(Curl_addrinfo));
|
||||
if(!ai)
|
||||
@ -90,7 +87,7 @@ static Curl_addrinfo *fake_ai(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ai->ai_addr = calloc(1, ss_size);
|
||||
ai->ai_addr = calloc(1, sizeof(struct sockaddr_in));
|
||||
if(!ai->ai_addr) {
|
||||
free(ai->ai_canonname);
|
||||
free(ai);
|
||||
@ -98,7 +95,7 @@ static Curl_addrinfo *fake_ai(void)
|
||||
}
|
||||
|
||||
ai->ai_family = AF_INET;
|
||||
ai->ai_addrlen = ss_size;
|
||||
ai->ai_addrlen = sizeof(struct sockaddr_in);
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user