diff options
| author | Tomas Chvatal (scarabeus) <tomas.chvatal@gmail.com> | 2008-10-22 22:50:54 +0200 |
|---|---|---|
| committer | Tomas Chvatal (scarabeus) <tomas.chvatal@gmail.com> | 2008-10-22 22:50:54 +0200 |
| commit | e12753d2ec9db83ec08bb9db63902a82fb245cdd (patch) | |
| tree | 6e4a63b790d6335f969f88b797a927e0fb25f37a /src/net/dns.c | |
| parent | 0b4d9821c7333b8c4bdf7e0eeb750aef502a1137 (diff) | |
X
Diffstat (limited to 'src/net/dns.c')
| -rw-r--r-- | src/net/dns.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/net/dns.c b/src/net/dns.c index 84c917a..98e6be9 100644 --- a/src/net/dns.c +++ b/src/net/dns.c @@ -1,5 +1,5 @@ #ifndef __WIN32__ -# include <sys/socket.h> +# include <sys/socket.h> # include <netinet/in.h> # include <arpa/inet.h> # include <netdb.h> @@ -12,16 +12,16 @@ #include "main.h" -char* getIPFormDNS(char *domain) +char * +getIPFormDNS(char *domain) { - struct hostent *host; + struct hostent *host; - host = gethostbyname(domain); + host = gethostbyname(domain); - if( host == NULL || host->h_addr_list[0] == NULL ) - { - return NULL; - } + if (host == NULL || host->h_addr_list[0] == NULL) { + return NULL; + } - return strdup( inet_ntoa( * ( (struct in_addr *) host->h_addr_list[0] ) ) ); + return strdup(inet_ntoa(*((struct in_addr *) host->h_addr_list[0]))); } |