From a1c31e73b6b094948daa9d77a429548017538f1c Mon Sep 17 00:00:00 2001 From: rofl0r Date: Thu, 4 Feb 2016 09:38:16 +0000 Subject: [PATCH] improve hostsreader test code --- src/hostsreader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hostsreader.c b/src/hostsreader.c index 2e6a4f1..b2b0b07 100644 --- a/src/hostsreader.c +++ b/src/hostsreader.c @@ -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