struct hostent *hostName;
struct in_addr ipv4addr;
inet_pton(AF_INET, inet_ntoa(client.sin_addr), &ipv4addr);
hostName = gethostbyaddr(&ipv4addr, sizeof(ipv4addr), AF_INET);
printf("Host name: %s\n", hostName->h_name);
It segfaults on the last line. I looked up proper use of hostent, and the msdn docs show it being used EXACTLY like this. What would cause the segfault?