From fc13f284179df5f3f3a1d475bf84da21dc89c970 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Apr 2006 01:43:13 +0000 Subject: r15030: On a performace hunt... Remove as many extraneous memset's as possible. Jeremy. (This used to be commit 1217ed392b75aa8bfefa9c3f1ec5fa3bba841ee0) --- source3/lib/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/lib/util.c') 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); -- cgit