pretty_print_dict print ints in lists

Bugfix #94
This commit is contained in:
Willem Toorop 2014-02-04 10:10:12 +01:00
parent 02e159c935
commit 7d29121721
2 changed files with 4 additions and 5 deletions

View File

@ -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:

View File

@ -46,7 +46,7 @@ static const char pretty_expected[] = "{\n"
" \"int\": 8,\n"
" \"list\":\n"
" [\n"
" 10 \n"
" 10\n"
" ]\n"
" },\n"
" [\n"