summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-02-24 16:16:23 +0100
committerVolker Lendecke <vl@samba.org>2012-02-24 18:07:48 +0100
commit61953ab35a59611e307d684a5f8dfa165e95053d (patch)
tree7c371be9cfca0056d300381c652bf919f2204573 /source3
parentb07ae1ab7b19d033e19c4b78c375c608f22548b3 (diff)
downloadsamba-61953ab35a59611e307d684a5f8dfa165e95053d.tar.gz
samba-61953ab35a59611e307d684a5f8dfa165e95053d.tar.bz2
samba-61953ab35a59611e307d684a5f8dfa165e95053d.zip
s3: Simplify smb_splice_chain
No code change, just remove a {} block left over as the else branch from the previous commit Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri Feb 24 18:07:48 CET 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/process.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index bdfc10d2bd..391ddc70ba 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1790,6 +1790,8 @@ static bool smb_splice_chain(uint8_t **poutbuf, const uint8_t *andx_buf)
size_t old_size, new_size;
size_t ofs;
size_t chain_padding = 0;
+ size_t andx_cmd_ofs;
+
old_size = talloc_get_size(*poutbuf);
@@ -1822,25 +1824,20 @@ static bool smb_splice_chain(uint8_t **poutbuf, const uint8_t *andx_buf)
}
*poutbuf = outbuf;
- {
- size_t andx_cmd_ofs;
-
- if (!find_andx_cmd_ofs(outbuf, &andx_cmd_ofs)) {
- DEBUG(1, ("invalid command chain\n"));
- *poutbuf = talloc_realloc(
- NULL, *poutbuf, uint8_t, old_size);
- return false;
- }
-
- if (chain_padding != 0) {
- memset(outbuf + old_size, 0, chain_padding);
- old_size += chain_padding;
- }
+ if (!find_andx_cmd_ofs(outbuf, &andx_cmd_ofs)) {
+ DEBUG(1, ("invalid command chain\n"));
+ *poutbuf = talloc_realloc(NULL, *poutbuf, uint8_t, old_size);
+ return false;
+ }
- SCVAL(outbuf, andx_cmd_ofs, smb_command);
- SSVAL(outbuf, andx_cmd_ofs + 2, old_size - 4);
+ if (chain_padding != 0) {
+ memset(outbuf + old_size, 0, chain_padding);
+ old_size += chain_padding;
}
+ SCVAL(outbuf, andx_cmd_ofs, smb_command);
+ SSVAL(outbuf, andx_cmd_ofs + 2, old_size - 4);
+
ofs = old_size;
/*