]> granicus.if.org Git - curl/commitdiff
if2ip: fix -Wcast-align warning
authorMarcel Raad <raad@teamviewer.com>
Tue, 25 Apr 2017 07:19:59 +0000 (09:19 +0200)
committerMarcel Raad <raad@teamviewer.com>
Tue, 25 Apr 2017 07:19:59 +0000 (09:19 +0200)
Follow-up to 119037325de02579f5c58256ca2ed2a0aa592c86, which fixed the
warning in the HAVE_GETIFADDRS block, but not in the
HAVE_IOCTL_SIOCGIFADDR block.

lib/if2ip.c

index d876615ea13a789d848f15ab165a943ef90242d9..4de81be60e099736ce4a333291df5021e0fecc21 100644 (file)
@@ -239,7 +239,7 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
     return IF2IP_NOT_FOUND;
   }
 
-  s = (struct sockaddr_in *)&req.ifr_addr;
+  s = (struct sockaddr_in *)(void *)&req.ifr_addr;
   memcpy(&in, &s->sin_addr, sizeof(in));
   Curl_inet_ntop(s->sin_family, &in, buf, buf_size);