summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2004-10-14 03:19:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:57 -0500
commit26c106e0838db54aafddf1e0f7e4781510dbc582 (patch)
tree6b3a582bc1c14d6ed7e0010640fd7518ef9d824c /source3/libsmb
parent7df1ed060be1fe730f78eb4665cdb5f1a3fef0c9 (diff)
downloadsamba-26c106e0838db54aafddf1e0f7e4781510dbc582.tar.gz
samba-26c106e0838db54aafddf1e0f7e4781510dbc582.tar.bz2
samba-26c106e0838db54aafddf1e0f7e4781510dbc582.zip
r2959: If we want to support writes >= 65536 with cli_write, then it had better
return a size_t, not an ssize_t, and we had better left shift the upper part of the write count, not right shift it. (This used to be commit 3eb33fbc64415600d62ff7b1f2edd67d2dac05b4)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clireadwrite.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 3f14e53094..d1a23d36c8 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -318,9 +318,9 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset,
0x0008 start of message mode named pipe protocol
****************************************************************************/
-ssize_t cli_write(struct cli_state *cli,
- int fnum, uint16 write_mode,
- const char *buf, off_t offset, size_t size)
+size_t cli_write(struct cli_state *cli,
+ int fnum, uint16 write_mode,
+ const char *buf, off_t offset, size_t size)
{
int bwritten = 0;
int issued = 0;
@@ -358,7 +358,7 @@ ssize_t cli_write(struct cli_state *cli,
break;
bwritten += SVAL(cli->inbuf, smb_vwv2);
- bwritten += (((int)(SVAL(cli->inbuf, smb_vwv4)))>>16);
+ bwritten += (((int)(SVAL(cli->inbuf, smb_vwv4)))<<16);
}
while (received < issued && cli_receive_smb(cli))