summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clireadwrite.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-01 13:18:35 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-01 13:18:35 +0000
commitba79d2a030b9ae087f0cc4248baa6cf6bee112fb (patch)
tree71784630355c8a733b6f5fb4c33e094116a86501 /source/libsmb/clireadwrite.c
parent200110a3b4caeb0d8be87f02476af29165e35ada (diff)
downloadsamba-ba79d2a030b9ae087f0cc4248baa6cf6bee112fb.tar.gz
samba-ba79d2a030b9ae087f0cc4248baa6cf6bee112fb.tar.xz
samba-ba79d2a030b9ae087f0cc4248baa6cf6bee112fb.zip
cli_read() was reading too many bytes.
Diffstat (limited to 'source/libsmb/clireadwrite.c')
-rw-r--r--source/libsmb/clireadwrite.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/libsmb/clireadwrite.c b/source/libsmb/clireadwrite.c
index 54d3fd18e3c..458532cb2ed 100644
--- a/source/libsmb/clireadwrite.c
+++ b/source/libsmb/clireadwrite.c
@@ -71,10 +71,9 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_
*/
readsize = (cli->max_xmit - (smb_size+32)) & ~1023;
- if (readsize > size )
- readsize = size;
while (total < size) {
+ readsize = MIN(readsize, size-total);
/* Issue a read and receive a reply */