]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
revert the changes to dns_name_format() back to dns_name_totext() because
authorDavid Lawrence <source@isc.org>
Mon, 31 Jul 2000 22:34:01 +0000 (22:34 +0000)
committerDavid Lawrence <source@isc.org>
Mon, 31 Jul 2000 22:34:01 +0000 (22:34 +0000)
dns_name_format() does not print absolute names

bin/tests/rbt_test.c
lib/dns/rbt.c

index 8a8bcc413c666969f03189324279bba6c5adbce9..80aafeb310d80bdc3ec9c80adad7d33853b11381 100644 (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
index 34ebac8e8e11f57e208cf0184472d865e44ad028..0f04f6a0ce043b5f35e4eeaa6e91e0296b8e94da 100644 (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);
+
+       /*
+        * ISC_FALSE means absolute names have the final dot added.
+        */
+       dns_name_totext(&name, ISC_FALSE, &target);
 
-       printf("%s", buffer);
+       printf("%.*s", (int)target.used, (char *)target.base);
 }
 
 static void