core: use string instead of compound literal
[rofl0r-proxychains-ng.git] / tests / test_gethostbyname.c
blobe8d6ad25f1e1cc9bf61aa3896b2da437e5e55402
1 #include <stdio.h>
2 #include <netdb.h>
3 #include "../src/common.c"
5 void printhostent(struct hostent *hp) {
6 char ipbuf[16];
7 pc_stringfromipv4(hp->h_addr_list[0], ipbuf);
8 printf("alias: %p, len: %d, name: %s, addrlist: %p, addrtype: %d, ip: %s\n",
9 hp->h_aliases,
10 hp->h_length,
11 hp->h_name,
12 hp->h_addr_list,
13 hp->h_addrtype,
14 ipbuf
17 int main(int argc, char**argv) {
18 struct hostent* ret;
19 if(argc == 1) return 1;
20 ret = gethostbyname(argv[1]);
21 if(ret) printhostent(ret);
22 return 0;