cli_read() was reading too many bytes.
authorAndrew Tridgell <tridge@samba.org>
Sun, 1 Jul 2001 13:18:35 +0000 (13:18 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 1 Jul 2001 13:18:35 +0000 (13:18 +0000)
source/libsmb/clireadwrite.c

index 54d3fd18e3c1a0df6f7cc50aff91d006f6163658..458532cb2ede02626736d76fcffcfd8bb8f652b1 100644 (file)
@@ -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 */