summaryrefslogtreecommitdiffstats
path: root/source/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-04-16 10:40:23 +0000
committerAndrew Tridgell <tridge@samba.org>2002-04-16 10:40:23 +0000
commitbac0093a9713416b1679d1bc167b70f02b06ef78 (patch)
tree258547eb20e6cd86a17422ff30ae7c9c4da0b4ac /source/include
parenta877eae24becad9e0cd5b33ffe0916a20d5ba227 (diff)
downloadsamba-bac0093a9713416b1679d1bc167b70f02b06ef78.tar.gz
samba-bac0093a9713416b1679d1bc167b70f02b06ef78.tar.xz
samba-bac0093a9713416b1679d1bc167b70f02b06ef78.zip
i forgot to commit these parts of the string handling patch earlier. Sorry.
Diffstat (limited to 'source/include')
-rw-r--r--source/include/smb_macros.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h
index c19be784a18..27a59616512 100644
--- a/source/include/smb_macros.h
+++ b/source/include/smb_macros.h
@@ -169,9 +169,12 @@
#define SMB_ROUNDUP_ALLOCATION(s) ((s) ? (SMB_ROUNDUP((SMB_OFF_T)((s)+1), ((SMB_OFF_T)SMB_ROUNDUP_ALLOCATION_SIZE))) : 0 )
/* Extra macros added by Ying Chen at IBM - speed increase by inlining. */
-#define smb_buf(buf) (buf + smb_size + CVAL(buf,smb_wct)*2)
+#define smb_buf(buf) ((buf) + smb_size + CVAL(buf,smb_wct)*2)
#define smb_buflen(buf) (SVAL(buf,smb_vwv0 + (int)CVAL(buf, smb_wct)*2))
+/* the remaining number of bytes in smb buffer 'buf' from pointer 'p'. */
+#define smb_bufrem(buf, p) (smb_buflen(buf)-PTR_DIFF(p, smb_buf(buf)))
+
/* Note that chain_size must be available as an extern int to this macro. */
#define smb_offset(p,buf) (PTR_DIFF(p,buf+4) + chain_size)