From: Wouter Wijngaards Date: Fri, 7 Dec 2007 14:54:10 +0000 (+0000) Subject: small fries. X-Git-Tag: release-0.9~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6ce1f426d65f1bebdad30417542051c7599e80b;p=thirdparty%2Funbound.git small fries. git-svn-id: file:///svn/unbound/trunk@821 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/Makefile.in b/Makefile.in index 0d5a2abd4..fedf9faa6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -91,7 +91,7 @@ LIBUNBOUND_SRC=$(patsubst $(srcdir)/%,%, \ LIBUNBOUND_OBJ=$(addprefix $(BUILD),$(LIBUNBOUND_SRC:.c=.o)) $(COMPAT_OBJ) ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \ $(TESTBOUND_SRC) $(LOCKVERIFY_SRC) $(PKTVIEW_SRC) $(SIGNIT_SRC) \ - $(MEMSTATS_SRC) $(CHECKCONF_SRC) $(LIBUNBOUND_SRC) + $(MEMSTATS_SRC) $(CHECKCONF_SRC) $(LIBUNBOUND_SRC) $(HOST_SRC) ALL_OBJ=$(addprefix $(BUILD),$(ALL_SRC:.c=.o) \ $(addprefix compat/,$(LIBOBJS))) $(COMPAT_OBJ) diff --git a/doc/Changelog b/doc/Changelog index 94e3d6e16..d227a3fe0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ - updated ldns-src.tar.gz with ldns-trunk today (1.2.2 fixes). - size_t to int for portability of the header file. - fixup bogus handling. + - dependencies and lint for unbound-host. 6 December 2007: Wouter - library resolution works in foreground mode, unbound-host app diff --git a/smallapp/unbound-host.c b/smallapp/unbound-host.c index 54d2ec39f..4b5651943 100644 --- a/smallapp/unbound-host.c +++ b/smallapp/unbound-host.c @@ -72,7 +72,7 @@ usage() exit(1); } -/** determine if str is ip4 */ +/** determine if str is ip4 and put into reverse lookup format */ static int isip4(const char* nm, char** res) { @@ -83,13 +83,13 @@ isip4(const char* nm, char** res) return 0; } snprintf(buf, sizeof(buf), "%u.%u.%u.%u.in-addr.arpa", - ((uint8_t*)&addr)[3], ((uint8_t*)&addr)[2], - ((uint8_t*)&addr)[1], ((uint8_t*)&addr)[0]); + (unsigned)((uint8_t*)&addr)[3], (unsigned)((uint8_t*)&addr)[2], + (unsigned)((uint8_t*)&addr)[1], (unsigned)((uint8_t*)&addr)[0]); *res = strdup(buf); return 1; } -/** determine if str is ip6 */ +/** determine if str is ip6 and put into reverse lookup format */ static int isip6(const char* nm, char** res) { @@ -112,6 +112,10 @@ isip6(const char* nm, char** res) } snprintf(buf+16*4, sizeof(buf)-16*4, "ip6.arpa"); *res = strdup(buf); + if(!*res) { + fprintf(stderr, "error: out of memory\n"); + exit(1); + } return 1; } @@ -183,7 +187,7 @@ statstr(int sec, struct ub_val_result* result) static void pretty_type(char* s, size_t len, int t) { - const ldns_rr_descriptor *d = ldns_rr_descript(t); + const ldns_rr_descriptor *d = ldns_rr_descript((uint16_t)t); if(d) { snprintf(s, len, "%s", d->_name); } else {