improve hostsreader test code

This commit is contained in:
rofl0r 2016-02-04 09:38:16 +00:00
parent f85cecdabe
commit a1c31e73b6

View File

@ -86,9 +86,11 @@ ip_type4 hostsreader_get_numeric_ip_for_name(const char* name) {
}
#ifdef HOSTSREADER_TEST
int main() {
#include "ip_type.c"
int main(int a, char**b) {
char buf[256];
char * ret = hostsreader_get_ip_for_name("goo", buf, sizeof buf);
if(a != 2) return 1;
char * ret = hostsreader_get_ip_for_name(b[1], buf, sizeof buf);
printf("%s\n", ret ? ret : "null");
}
#endif