diff options
-rw-r--r-- | source3/lib/util.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index f31ae390aa..b7ad0bb5bc 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -995,6 +995,7 @@ void dos_format(char *fname) void show_msg(char *buf) { int i; + int j; int bcc=0; if (DEBUGLEVEL < 5) return; @@ -1020,9 +1021,28 @@ void show_msg(char *buf) DEBUG(5,("smb_bcc=%d\n",bcc)); if (DEBUGLEVEL < 10) return; - for (i=0;i<MIN(bcc,128);i++) - DEBUG(10,("%X ",CVAL(smb_buf(buf),i))); - DEBUG(10,("\n")); + for (i = 0; i < MIN(bcc, 256); i += 16) + { + for (j = 0; j < 16 && i+j < MIN(bcc,256); j++) + { + + DEBUG(10,("%2X ",CVAL(smb_buf(buf),i+j))); + if (j == 7) DEBUG(10, (" ")); + + } + DEBUG(10,(" ")); + + for (j = 0; j < 16 && i+j < MIN(bcc,256); j++) + { + unsigned char c = CVAL(smb_buf(buf),i+j); + if (c < 32 || c > 128) c = '.'; + DEBUG(10,("%c",c)); + + if (j == 7) DEBUG(10, (" ")); + } + + DEBUG(10,("\n")); + } } /******************************************************************* |