diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-04-16 10:40:23 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-04-16 10:40:23 +0000 |
commit | 02f84c6bd0c06c3dacc93d6413d6645367f42744 (patch) | |
tree | 11ab6017e80520c47995b4e46ca79e175ba80268 /source3/include | |
parent | e7b729e0d9d6264e85be042b16aa6aee0648fcfd (diff) | |
download | samba-02f84c6bd0c06c3dacc93d6413d6645367f42744.tar.gz samba-02f84c6bd0c06c3dacc93d6413d6645367f42744.tar.bz2 samba-02f84c6bd0c06c3dacc93d6413d6645367f42744.zip |
i forgot to commit these parts of the string handling patch earlier. Sorry.
(This used to be commit bac0093a9713416b1679d1bc167b70f02b06ef78)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/smb_macros.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index c19be784a1..27a5961651 100644 --- a/source3/include/smb_macros.h +++ b/source3/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) |