mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +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
|
2554. [bug] Validation of uppercase queries from NSEC3 zones could
|
||||||
fail. [RT #19297]
|
fail. [RT #19297]
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* 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
|
/*! \file
|
||||||
* \note
|
* \note
|
||||||
@@ -393,7 +393,7 @@ count_dots(char *string) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
hex_dump(isc_buffer_t *b) {
|
hex_dump(isc_buffer_t *b) {
|
||||||
unsigned int len;
|
unsigned int len, i;
|
||||||
isc_region_t r;
|
isc_region_t r;
|
||||||
|
|
||||||
isc_buffer_usedregion(b, &r);
|
isc_buffer_usedregion(b, &r);
|
||||||
@@ -401,11 +401,29 @@ hex_dump(isc_buffer_t *b) {
|
|||||||
printf("%d bytes\n", r.length);
|
printf("%d bytes\n", r.length);
|
||||||
for (len = 0; len < r.length; len++) {
|
for (len = 0; len < r.length; len++) {
|
||||||
printf("%02x ", r.base[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");
|
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");
|
printf("\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*%
|
/*%
|
||||||
|
Reference in New Issue
Block a user