diff options
author | Jeremy Allison <jra@samba.org> | 2002-09-30 05:19:43 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-09-30 05:19:43 +0000 |
commit | 09507f5315aa3c4448cb8673d9d05d5ac4cb9c11 (patch) | |
tree | d30cae7ccb36a51146520eec86d8d6e39507ff80 /source3/lib | |
parent | a2b150ee89f7d05ecc819801d01fb202e06b9ede (diff) | |
download | samba-09507f5315aa3c4448cb8673d9d05d5ac4cb9c11.tar.gz samba-09507f5315aa3c4448cb8673d9d05d5ac4cb9c11.tar.bz2 samba-09507f5315aa3c4448cb8673d9d05d5ac4cb9c11.zip |
Don't zero out numwritten before using.... Found by Pierre Belanger belanger@pobox.com
Jeremy.
(This used to be commit a7009ad5c8aaae350b2521b8c0cd2538e561618a)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/sendfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/sendfile.c b/source3/lib/sendfile.c index 98a52608b8..5d1cf2f10b 100644 --- a/source3/lib/sendfile.c +++ b/source3/lib/sendfile.c @@ -208,10 +208,10 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of hdtrl[0].iov_base = NULL; hdtrl[0].iov_len = 0; } else { - nwritten = 0; /* iov_base is defined as a void *... */ hdtrl[0].iov_base = ((char *)hdtrl[0].iov_base) + nwritten; hdtrl[0].iov_len -= nwritten; + nwritten = 0; } } total -= nwritten; @@ -280,9 +280,9 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of hdtrl.iov_base = NULL; hdtrl.iov_len = 0; } else { - nwritten = 0; hdtrl.iov_base += nwritten; hdtrl.iov_len -= nwritten; + nwritten = 0; } } total -= nwritten; |