summaryrefslogtreecommitdiff
path: root/xhost.c
diff options
context:
space:
mode:
Diffstat (limited to 'xhost.c')
-rw-r--r--xhost.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/xhost.c b/xhost.c
index 22304bd..26ba179 100644
--- a/xhost.c
+++ b/xhost.c
@@ -544,12 +544,7 @@ change_host(Display *dpy, char *name, Bool add)
* First see if inet_aton/inet_addr can grok the name; if so, then use it.
*/
if (((family == FamilyWild) || (family == FamilyInternet)) &&
-#ifdef HAVE_INET_ATON
- (inet_aton (name, &addr) != 0)
-#else
- ((addr.s_addr = inet_addr(name)) != -1)
-#endif
- ) {
+ (inet_pton (AF_INET, name, &addr) == 1)) {
ha.family = FamilyInternet;
ha.length = sizeof(addr.s_addr);
ha.address = (char *) &addr.s_addr;