diff options
| author | xHire <xhire@tuxportal.cz> | 2008-10-25 14:11:06 +0200 |
|---|---|---|
| committer | xHire <xhire@tuxportal.cz> | 2008-10-25 14:11:06 +0200 |
| commit | c8a9209d77a896bf49227e5aeccd54e91ccf29cc (patch) | |
| tree | 6b7367406ebbc6ce3ea5e0c8668c75f6fb3f6ae9 /src/net/dns.c | |
| parent | cb9deba915dd7b114eeb76601eb1c8b07c1ba90f (diff) | |
Changed style of the code to the K&R standard
Diffstat (limited to 'src/net/dns.c')
| -rw-r--r-- | src/net/dns.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/net/dns.c b/src/net/dns.c index 44bb6ae..2167a52 100644 --- a/src/net/dns.c +++ b/src/net/dns.c @@ -1,27 +1,26 @@ #ifndef __WIN32__ -# include <sys/socket.h> -# include <netinet/in.h> -# include <arpa/inet.h> -# include <netdb.h> +# include <sys/socket.h> +# include <netinet/in.h> +# include <arpa/inet.h> +# include <netdb.h> #else -# include <windows.h> -# include <wininet.h> +# include <windows.h> +# include <wininet.h> #endif #include <string.h> #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]))); } |