summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clireadwrite.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 54d3fd18e3..458532cb2e 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/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 */