2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

2554. [func] dig: when emitting a hex dump also display the

corresponding characters. [RT #19258]
This commit is contained in:
Mark Andrews
2009-02-16 00:01:37 +00:00
parent 7d211b458f
commit cac4576405
2 changed files with 25 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
2554. [func] dig: when emitting a hex dump also display the
corresponding characters. [RT #19258]
2554. [bug] Validation of uppercase queries from NSEC3 zones could
fail. [RT #19297]

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.318 2009/01/20 04:39:29 marka Exp $ */
/* $Id: dighost.c,v 1.319 2009/02/16 00:01:37 marka Exp $ */
/*! \file
* \note
@@ -393,7 +393,7 @@ count_dots(char *string) {
static void
hex_dump(isc_buffer_t *b) {
unsigned int len;
unsigned int len, i;
isc_region_t r;
isc_buffer_usedregion(b, &r);
@@ -401,11 +401,29 @@ hex_dump(isc_buffer_t *b) {
printf("%d bytes\n", r.length);
for (len = 0; len < r.length; len++) {
printf("%02x ", r.base[len]);
if (len % 16 == 15)
if (len % 16 == 15) {
fputs(" ", stdout);
for (i = len - 15; i <= len; i++) {
if (r.base[i] >= '!' && r.base[i] <= '}')
putchar(r.base[i]);
else
putchar('.');
}
printf("\n");
}
}
if (len % 16 != 0)
if (len % 16 != 0) {
for (i = len; (i % 16) != 0; i++)
fputs(" ", stdout);
fputs(" ", stdout);
for (i = ((len>>4)<<4); i < len; i++) {
if (r.base[i] >= '!' && r.base[i] <= '}')
putchar(r.base[i]);
else
putchar('.');
}
printf("\n");
}
}
/*%