diff options
author | Marcel Raad <raad@teamviewer.com> | 2017-05-05 11:44:22 +0200 |
---|---|---|
committer | Marcel Raad <raad@teamviewer.com> | 2017-05-05 11:44:22 +0200 |
commit | ad8c1472fec946a9bae2d688bbadb7d77123b147 (patch) | |
tree | 3c552b41ee33e679eb597b60443c4c8b43a11dfb | |
parent | 1ef38a95d27d51366ca291c332af9f35782896bf (diff) |
unit1305: fix compiler warning
calloc and ai_addrlen expect different (usually unsigned) types.
-rw-r--r-- | tests/unit/unit1305.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/unit/unit1305.c b/tests/unit/unit1305.c index db0a44c5f..b958d0434 100644 --- a/tests/unit/unit1305.c +++ b/tests/unit/unit1305.c @@ -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; } |