1
0
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:
Marcel Raad 2017-05-05 11:44:22 +02:00
parent 1ef38a95d2
commit ad8c1472fe
No known key found for this signature in database
GPG Key ID: B7F13D981BBF1607

View File

@ -76,9 +76,6 @@ static void unit_stop(void)
static Curl_addrinfo *fake_ai(void) static Curl_addrinfo *fake_ai(void)
{ {
static Curl_addrinfo *ai; static Curl_addrinfo *ai;
int ss_size;
ss_size = sizeof(struct sockaddr_in);
ai = calloc(1, sizeof(Curl_addrinfo)); ai = calloc(1, sizeof(Curl_addrinfo));
if(!ai) if(!ai)
@ -90,7 +87,7 @@ static Curl_addrinfo *fake_ai(void)
return NULL; return NULL;
} }
ai->ai_addr = calloc(1, ss_size); ai->ai_addr = calloc(1, sizeof(struct sockaddr_in));
if(!ai->ai_addr) { if(!ai->ai_addr) {
free(ai->ai_canonname); free(ai->ai_canonname);
free(ai); free(ai);
@ -98,7 +95,7 @@ static Curl_addrinfo *fake_ai(void)
} }
ai->ai_family = AF_INET; ai->ai_family = AF_INET;
ai->ai_addrlen = ss_size; ai->ai_addrlen = sizeof(struct sockaddr_in);
return ai; return ai;
} }