From 12adae4398116bc9807ff97669e85726a60dcd70 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Wed, 30 Mar 2016 13:40:07 +0200 Subject: [PATCH] Small fixes for embarrassing bugs The 'struct tm tm' declaration in convert_smb_date_time_to_tm() must be static, not auto. Seek mode decoding was off by one. --- source_code/dump_smb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source_code/dump_smb.c b/source_code/dump_smb.c index 38a6dc2..fd77242 100644 --- a/source_code/dump_smb.c +++ b/source_code/dump_smb.c @@ -523,7 +523,7 @@ print_smb_data(struct line_buffer * lb,int num_data_bytes_left,const unsigned ch static const struct tm * convert_smb_date_time_to_tm(unsigned short smb_date,unsigned short smb_time) { - struct tm tm; + static struct tm tm; memset(&tm,0,sizeof(tm)); @@ -1743,17 +1743,17 @@ print_smb_contents(const struct smb_header * header,int command,enum smb_packet_ switch(mode) { - case 1: + case 0: Printf(" Seek from the start of the file\n"); break; - case 2: + case 1: Printf(" Seek from the current position\n"); break; - case 3: + case 2: Printf(" Seek from the end of the file\n"); break;