if ((addr = inet_addr("192.168.1.1")) == (in_addr_t)-1) { // Invalid address }With:
#include <Ws2tcpip.h> ... if ((inet_pton(AF_INET, "192.168.1.1", &addr)) != 1) { // Invalid address perror("inet_pton"); }
if ((addr = inet_addr("192.168.1.1")) == (in_addr_t)-1) { // Invalid address }With:
#include <Ws2tcpip.h> ... if ((inet_pton(AF_INET, "192.168.1.1", &addr)) != 1) { // Invalid address perror("inet_pton"); }