From f00518d061b17cd613be4089e52f0b7eb6460456 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Tue, 16 Mar 2010 10:05:26 +0000 Subject: [PATCH] Remove the u_long that may be incompatible with mini mac --- CMakeLists.txt | 2 +- include/info.h | 2 +- ip2name.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31db962..cf8a39e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(sarg C) SET(sarg_VERSION 2) SET(sarg_REVISION "3rc1") SET(sarg_BUILD "") -SET(sarg_BUILDDATE "Mar-12-2010") +SET(sarg_BUILDDATE "Mar-16-2010") INCLUDE(AddFileDependencies) INCLUDE(CheckIncludeFile) diff --git a/include/info.h b/include/info.h index 0836793..9d1164f 100755 --- a/include/info.h +++ b/include/info.h @@ -1,3 +1,3 @@ -#define VERSION PACKAGE_VERSION" Mar-12-2010" +#define VERSION PACKAGE_VERSION" Mar-16-2010" #define PGM PACKAGE_NAME #define URL "http://sarg.sourceforge.net" diff --git a/ip2name.c b/ip2name.c index d7938aa..92be758 100644 --- a/ip2name.c +++ b/ip2name.c @@ -54,14 +54,14 @@ void ip2name(char *ip,int ip_len) debuga(_("IP to name resolution (getnameinfo) on IP address %s failed with error %d - %s\n"),ip,error,gai_strerror(error)); } #else - u_long addr; + struct in_addr addr; struct hostent *hp; char **p; - if ((int)(addr = inet_addr(ip)) == -1) + if (inet_aton(ip,&addr) == 0) return; - hp = gethostbyaddr((char *)&addr, sizeof (addr), AF_INET); + hp = gethostbyaddr(&addr, sizeof (addr), AF_INET); if (hp == NULL) return; -- 2.47.2