Moved common code to set parameter offset field correctly oout of 'if'
authorJeremy Allison <jra@samba.org>
Tue, 28 Mar 2000 02:20:57 +0000 (02:20 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 28 Mar 2000 02:20:57 +0000 (02:20 +0000)
statement into main function code path.
Jeremy.
(This used to be commit f15ca0d9273d718534ba2fdd2ccd14ab90a95c8b)

source3/smbd/trans2.c

index 24abf60a79871f37ed5f18f3d6f3157a574761b7..38f2802df3faa2bb2431d121216f6dab530e291c 100644 (file)
@@ -118,21 +118,19 @@ static int send_trans2_replies(char *outbuf, int bufsize, char *params,
     data_sent_thistime = MIN(data_sent_thistime,data_to_send);
 
     SSVAL(outbuf,smb_prcnt, params_sent_thistime);
+
+    /* smb_proff is the offset from the start of the SMB header to the
+       parameter bytes, however the first 4 bytes of outbuf are
+       the Netbios over TCP header. Thus use smb_base() to subtract
+       them from the calculation */
+
+    SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf)));
+
     if(params_sent_thistime == 0)
-    {
-      SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf))); 
       SSVAL(outbuf,smb_prdisp,0);
-    }
     else
-    {
-      /* smb_proff is the offset from the start of the SMB header to the
-         parameter bytes, however the first 4 bytes of outbuf are
-         the Netbios over TCP header. Thus use smb_base() to subtract
-         them from the calculation */
-      SSVAL(outbuf,smb_proff,((smb_buf(outbuf)+alignment_offset) - smb_base(outbuf)));
       /* Absolute displacement of param bytes sent in this packet */
       SSVAL(outbuf,smb_prdisp,pp - params);
-    }
 
     SSVAL(outbuf,smb_drcnt, data_sent_thistime);
     if(data_sent_thistime == 0)