* sysdump.c (dh): Changed format of output to be 16 hex digits

followed by 16 ascii characters, similar to Emacs' hexl-mode,
to make it easier to read.
This commit is contained in:
J.T. Conklin 1995-07-14 20:47:19 +00:00
parent 63e1380d57
commit 5a25ad782b
2 changed files with 7 additions and 8 deletions

Binary file not shown.

View File

@ -84,27 +84,26 @@ dh (ptr, size)
{
int i;
int j;
int span = 20;
int span = 16;
printf ("\n************************************************************\n");
for (i = 0; i < size; i += span)
{
for (j = 0; j < span && j + i < size; j++)
for (j = 0; j < span; j++)
{
printf ("%02x ", ptr[i + j]);
if (j + i < size)
printf ("%02x ", ptr[i + j]);
else
printf (" ");
}
printf ("\n");
}
for (i = 0; i < size; i += span)
{
for (j = 0; j < span && j + i < size; j++)
{
int c = ptr[i + j];
if (c < 32 || c > 127)
c = '.';
printf (" %c ", c);
printf ("%c", c);
}
printf ("\n");
}