Fixes some code indentation, and bug in checking the return value of inet_ntop
Fixes bug when checking return argument of inet_ntop()