ESP32Ping icon indicating copy to clipboard operation
ESP32Ping copied to clipboard

minor topic: ping.cpp - ping_recv(...) simplify inet_ntoa(...)

Open adynis opened this issue 4 years ago • 0 comments

In place of:

// Get from IP address
ip4_addr_t fromaddr;
inet_addr_to_ip4addr(&fromaddr, &from.sin_addr);
strcpy(ipa, inet_ntoa(fromaddr));

later edit: which sometimes returs "0.0.0.0" for "www.google.ro"

it's easier/better to write:

// Get from IP address
strcpy(ipa, inet_ntoa(from.sin_addr));

adynis avatar Mar 14 '20 00:03 adynis