From 7d2912172100ad53a175b2f3bc7e7bef9be51adb Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Tue, 4 Feb 2014 10:10:12 +0100 Subject: [PATCH] pretty_print_dict print ints in lists Bugfix #94 --- src/dict.c | 7 +++---- src/test/check_getdns_pretty_print_dict.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/dict.c b/src/dict.c index c14043d8..e9bb3aca 100644 --- a/src/dict.c +++ b/src/dict.c @@ -610,10 +610,9 @@ getdns_pp_list(ldns_buffer * buf, size_t indent, struct getdns_list *list) switch (dtype) { case t_int: if (getdns_list_get_int(list, i, &int_item) != - GETDNS_RETURN_GOOD) - if (ldns_buffer_printf(buf, " %d", - (int) int_item) < 0) - return -1; + GETDNS_RETURN_GOOD || + ldns_buffer_printf(buf, "%d", (int) int_item) < 0) + return -1; break; case t_bindata: diff --git a/src/test/check_getdns_pretty_print_dict.h b/src/test/check_getdns_pretty_print_dict.h index a5c1f7e4..340c17ae 100644 --- a/src/test/check_getdns_pretty_print_dict.h +++ b/src/test/check_getdns_pretty_print_dict.h @@ -46,7 +46,7 @@ static const char pretty_expected[] = "{\n" " \"int\": 8,\n" " \"list\":\n" " [\n" -" 10 \n" +" 10\n" " ]\n" " },\n" " [\n"