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:
3
CHANGES
3
CHANGES
@@ -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]
|
||||
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
/*%
|
||||
|
Reference in New Issue
Block a user