diff options
-rw-r--r-- | source3/lib/util.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 9cecd4beb1..7f47cdbdb4 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1165,10 +1165,9 @@ void dos_format(char *fname) void show_msg(char *buf) { int i; - int j; int bcc=0; - if (DEBUGLEVEL < 5) - return; + + if (DEBUGLEVEL < 5) return; DEBUG(5,("size=%d\nsmb_com=0x%x\nsmb_rcls=%d\nsmb_reh=%d\nsmb_err=%d\nsmb_flg=%d\nsmb_flg2=%d\n", smb_len(buf), @@ -1184,35 +1183,17 @@ void show_msg(char *buf) (int)SVAL(buf,smb_uid), (int)SVAL(buf,smb_mid), (int)CVAL(buf,smb_wct))); + for (i=0;i<(int)CVAL(buf,smb_wct);i++) DEBUG(5,("smb_vwv[%d]=%d (0x%X)\n",i, SVAL(buf,smb_vwv+2*i),SVAL(buf,smb_vwv+2*i))); + bcc = (int)SVAL(buf,smb_vwv+2*(CVAL(buf,smb_wct))); DEBUG(5,("smb_bcc=%d\n",bcc)); - if (DEBUGLEVEL < 10) - return; - for (i = 0; i < MIN(bcc, 512); i += 16) - { - for (j = 0; j < 16 && i+j < MIN(bcc,512); j++) - { - DEBUG(10,("%2X ",CVAL(smb_buf(buf),i+j))); - if (j == 7) DEBUG(10, (" ")); + if (DEBUGLEVEL < 10) return; - } - DEBUG(10,(" ")); - - for (j = 0; j < 16 && i+j < MIN(bcc,512); 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")); -} + dump_data(10, smb_buf(buf), MIN(bcc, 512)); } /******************************************************************* |