From: J.T. Conklin Date: Fri, 14 Jul 1995 20:47:19 +0000 (+0000) Subject: * sysdump.c (dh): Changed format of output to be 16 hex digits X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a25ad782b1016c0b6d9beac78ec05203f3f9474;p=binutils-gdb.git * 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. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 6bb5d0d38f7..f0e7ae08813 100644 Binary files a/binutils/ChangeLog and b/binutils/ChangeLog differ diff --git a/binutils/sysdump.c b/binutils/sysdump.c index aa7b7cdd9ac..891ce1396cc 100644 --- a/binutils/sysdump.c +++ b/binutils/sysdump.c @@ -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"); }