Fix a type mismatch on android.

This commit is contained in:
Bill Currie 2012-02-05 14:28:23 +09:00
parent 4bd6bca6f2
commit cef004fc15

View file

@ -205,8 +205,8 @@ get_iface_list (int sock)
} }
freeifaddrs (ifa_head); freeifaddrs (ifa_head);
return 0; return 0;
#endif
no_ifaddrs: no_ifaddrs:
#endif
ifaces = &myAddr; ifaces = &myAddr;
default_iface = &ifaces[0]; default_iface = &ifaces[0];
num_ifaces = 1; num_ifaces = 1;
@ -583,7 +583,8 @@ UDP_GetNameFromAddr (netadr_t *addr, char *name)
{ {
struct hostent *hostentry; struct hostent *hostentry;
hostentry = gethostbyaddr (&addr->ip, ADDR_SIZE, AF_INET); //FIXME the cast is an evil hack for android
hostentry = gethostbyaddr ((char *) &addr->ip, ADDR_SIZE, AF_INET);
if (hostentry) { if (hostentry) {
strncpy (name, (char *) hostentry->h_name, NET_NAMELEN - 1); strncpy (name, (char *) hostentry->h_name, NET_NAMELEN - 1);