Let tests_stub_sync print reply dict pretty

This commit is contained in:
Willem Toorop 2013-11-04 10:33:27 -08:00
parent 2d1ad47f07
commit bd7740fefa
1 changed files with 4 additions and 7 deletions

View File

@ -33,13 +33,10 @@
#include <getdns/getdns.h> #include <getdns/getdns.h>
static void print_response(getdns_dict* response) { static void print_response(getdns_dict* response) {
getdns_bindata* bindata = NULL; char *dict_str = getdns_pretty_print_dict(response);
getdns_dict_get_bindata(response, "pkt", &bindata); if (dict_str) {
if (bindata) { fprintf(stdout, "The packet %s\n", dict_str);
char* data = (char*) bindata->data; free(dict_str);
data[bindata->size] = 0;
memcpy(data, bindata->data, bindata->size);
fprintf(stdout, "The packet %s\n", data);
} }
} }