summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-02-20 12:45:50 +0000
committerAndrew Tridgell <tridge@samba.org>2001-02-20 12:45:50 +0000
commit0a8992e224b7a3d90d45b13d73fa8a6f155efa79 (patch)
tree29b31abc9c58170407b82a52bd9e12e7ac43e95f /source/lib/util.c
parentdb60c0c26242be0370e6459fe6f1634c97b61176 (diff)
downloadsamba-0a8992e224b7a3d90d45b13d73fa8a6f155efa79.tar.gz
samba-0a8992e224b7a3d90d45b13d73fa8a6f155efa79.tar.xz
samba-0a8992e224b7a3d90d45b13d73fa8a6f155efa79.zip
- neater setting of bcc
- converted cli_rename and cli_unlink
Diffstat (limited to 'source/lib/util.c')
-rw-r--r--source/lib/util.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 2d922aab702..70513c068ee 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -335,12 +335,22 @@ void smb_setlen(char *buf,int len)
********************************************************************/
int set_message(char *buf,int num_words,int num_bytes,BOOL zero)
{
- if (zero)
- memset(buf + smb_size,'\0',num_words*2 + num_bytes);
- CVAL(buf,smb_wct) = num_words;
- SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
- smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4);
- return (smb_size + num_words*2 + num_bytes);
+ if (zero)
+ memset(buf + smb_size,'\0',num_words*2 + num_bytes);
+ CVAL(buf,smb_wct) = num_words;
+ SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
+ smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4);
+ return (smb_size + num_words*2 + num_bytes);
+}
+
+/*******************************************************************
+ setup only the byte count for a smb message
+********************************************************************/
+void set_message_bcc(char *buf,int num_bytes)
+{
+ int num_words = CVAL(buf,smb_wct);
+ SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
+ smb_setlen(buf,smb_size + num_words*2 + num_bytes - 4);
}
/*******************************************************************