Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adynis opened this issue Mar 14, 2020 · 0 comments
Open

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

adynis opened this issue Mar 14, 2020 · 0 comments

Comments

@adynis
Copy link

adynis commented Mar 14, 2020

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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant