revert the changes to dns_name_format() back to dns_name_totext() because

dns_name_format() does not print absolute names
This commit is contained in:
David Lawrence
2000-07-31 22:34:01 +00:00
parent e4bd5f6907
commit 9658892dbc
2 changed files with 21 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbt_test.c,v 1.36 2000/07/28 02:59:05 tale Exp $ */
/* $Id: rbt_test.c,v 1.37 2000/07/31 22:33:59 tale Exp $ */
#include <config.h>
@@ -95,10 +95,17 @@ delete_name(void *data, void *arg) {
static void
print_name(dns_name_t *name) {
isc_buffer_t target;
char buffer[1024];
dns_name_format(name, buffer, sizeof(buffer));
printf("%s", buffer);
isc_buffer_init(&target, buffer, sizeof(buffer));
/*
* ISC_FALSE means absolute names have the final dot added.
*/
dns_name_totext(name, ISC_FALSE, &target);
printf("%.*s", (int)target.used, (char *)target.base);
}
static void

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbt.c,v 1.87 2000/07/27 09:46:21 tale Exp $ */
/* $Id: rbt.c,v 1.88 2000/07/31 22:34:01 tale Exp $ */
/* Principal Authors: DCL */
@@ -1841,19 +1841,26 @@ dns_rbt_indent(int depth) {
static void
dns_rbt_printnodename(dns_rbtnode_t *node) {
isc_buffer_t target;
isc_region_t r;
dns_name_t name;
char buffer[1024];
dns_offsets_t offsets;
r.length = NAMELEN(node);
r.base = NAME(node);
dns_name_init(&name, NULL);
dns_name_init(&name, offsets);
dns_name_fromregion(&name, &r);
dns_name_format(&name, buffer, sizeof(buffer));
isc_buffer_init(&target, buffer, 255);
printf("%s", buffer);
/*
* ISC_FALSE means absolute names have the final dot added.
*/
dns_name_totext(&name, ISC_FALSE, &target);
printf("%.*s", (int)target.used, (char *)target.base);
}
static void