report if dns_rdata{class,type}_totext failed

This commit is contained in:
Mark Andrews
2011-08-28 09:16:12 +00:00
parent 9ef4102af7
commit 8917b20b15

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata_test.c,v 1.48.332.2 2011/08/16 23:45:14 tbox Exp $ */
/* $Id: rdata_test.c,v 1.48.332.3 2011/08/28 09:16:12 marka Exp $ */
#include <config.h>
@@ -973,6 +973,15 @@ main(int argc, char *argv[]) {
type = token.value.as_ulong;
isc_buffer_init(&tbuf, outbuf, sizeof(outbuf));
result = dns_rdatatype_totext(type, &tbuf);
if (result != ISC_R_SUCCESS) {
fprintf(stdout,
"dns_rdatatype_totext "
"returned %s(%d)\n",
dns_result_totext(result), result);
fflush(stdout);
need_eol = 1;
continue;
}
fprintf(stdout, "type = %.*s(%d)\n",
(int)tbuf.used, (char*)tbuf.base, type);
} else if (token.type == isc_tokentype_string) {
@@ -1005,6 +1014,14 @@ main(int argc, char *argv[]) {
class = token.value.as_ulong;
isc_buffer_init(&tbuf, outbuf, sizeof(outbuf));
result = dns_rdatatype_totext(class, &tbuf);
if (result != ISC_R_SUCCESS) {
fprintf(stdout, "dns_rdatatype_totext "
"returned %s(%d)\n",
dns_result_totext(result), result);
fflush(stdout);
need_eol = 1;
continue;
}
fprintf(stdout, "class = %.*s(%d)\n",
(int)tbuf.used, (char*)tbuf.base, class);
} else if (token.type == isc_tokentype_string) {