small fries.

git-svn-id: file:///svn/unbound/trunk@821 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-12-07 14:54:10 +00:00
parent 9f97c4ac44
commit d6ce1f426d
3 changed files with 11 additions and 6 deletions

View file

@ -91,7 +91,7 @@ LIBUNBOUND_SRC=$(patsubst $(srcdir)/%,%, \
LIBUNBOUND_OBJ=$(addprefix $(BUILD),$(LIBUNBOUND_SRC:.c=.o)) $(COMPAT_OBJ) LIBUNBOUND_OBJ=$(addprefix $(BUILD),$(LIBUNBOUND_SRC:.c=.o)) $(COMPAT_OBJ)
ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \ ALL_SRC=$(COMMON_SRC) $(UNITTEST_SRC) $(DAEMON_SRC) \
$(TESTBOUND_SRC) $(LOCKVERIFY_SRC) $(PKTVIEW_SRC) $(SIGNIT_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) \ ALL_OBJ=$(addprefix $(BUILD),$(ALL_SRC:.c=.o) \
$(addprefix compat/,$(LIBOBJS))) $(COMPAT_OBJ) $(addprefix compat/,$(LIBOBJS))) $(COMPAT_OBJ)

View file

@ -7,6 +7,7 @@
- updated ldns-src.tar.gz with ldns-trunk today (1.2.2 fixes). - updated ldns-src.tar.gz with ldns-trunk today (1.2.2 fixes).
- size_t to int for portability of the header file. - size_t to int for portability of the header file.
- fixup bogus handling. - fixup bogus handling.
- dependencies and lint for unbound-host.
6 December 2007: Wouter 6 December 2007: Wouter
- library resolution works in foreground mode, unbound-host app - library resolution works in foreground mode, unbound-host app

View file

@ -72,7 +72,7 @@ usage()
exit(1); exit(1);
} }
/** determine if str is ip4 */ /** determine if str is ip4 and put into reverse lookup format */
static int static int
isip4(const char* nm, char** res) isip4(const char* nm, char** res)
{ {
@ -83,13 +83,13 @@ isip4(const char* nm, char** res)
return 0; return 0;
} }
snprintf(buf, sizeof(buf), "%u.%u.%u.%u.in-addr.arpa", snprintf(buf, sizeof(buf), "%u.%u.%u.%u.in-addr.arpa",
((uint8_t*)&addr)[3], ((uint8_t*)&addr)[2], (unsigned)((uint8_t*)&addr)[3], (unsigned)((uint8_t*)&addr)[2],
((uint8_t*)&addr)[1], ((uint8_t*)&addr)[0]); (unsigned)((uint8_t*)&addr)[1], (unsigned)((uint8_t*)&addr)[0]);
*res = strdup(buf); *res = strdup(buf);
return 1; return 1;
} }
/** determine if str is ip6 */ /** determine if str is ip6 and put into reverse lookup format */
static int static int
isip6(const char* nm, char** res) 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"); snprintf(buf+16*4, sizeof(buf)-16*4, "ip6.arpa");
*res = strdup(buf); *res = strdup(buf);
if(!*res) {
fprintf(stderr, "error: out of memory\n");
exit(1);
}
return 1; return 1;
} }
@ -183,7 +187,7 @@ statstr(int sec, struct ub_val_result* result)
static void static void
pretty_type(char* s, size_t len, int t) 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) { if(d) {
snprintf(s, len, "%s", d->_name); snprintf(s, len, "%s", d->_name);
} else { } else {