summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-04-11 01:43:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:58 -0500
commitfc13f284179df5f3f3a1d475bf84da21dc89c970 (patch)
treef5df9fc2aa7961be3ac6afc8b033950964416c38 /source3/lib/util.c
parent41a35cfe940ceba7b89eec776ca78eec8eeb4a82 (diff)
downloadsamba-fc13f284179df5f3f3a1d475bf84da21dc89c970.tar.gz
samba-fc13f284179df5f3f3a1d475bf84da21dc89c970.tar.bz2
samba-fc13f284179df5f3f3a1d475bf84da21dc89c970.zip
r15030: On a performace hunt... Remove as many extraneous
memset's as possible. Jeremy. (This used to be commit 1217ed392b75aa8bfefa9c3f1ec5fa3bba841ee0)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 87f15b8759..bbc9ceddca 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -529,8 +529,9 @@ void smb_setlen(char *buf,int len)
int set_message(char *buf,int num_words,int num_bytes,BOOL zero)
{
- if (zero)
+ if (zero && (num_words || num_bytes)) {
memset(buf + smb_size,'\0',num_words*2 + num_bytes);
+ }
SCVAL(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);