summaryrefslogtreecommitdiff
path: root/source3/lib/sendfile.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-30 05:24:12 +0000
committerJeremy Allison <jra@samba.org>2002-09-30 05:24:12 +0000
commitf6bdffbf8dfc28329e87fcc383008c685110db96 (patch)
tree58b4660bf6aedb61007c1c83714a73c38bf0dc67 /source3/lib/sendfile.c
parentf9789eb987f5cec9a9b5125815cb3de4ea88349b (diff)
downloadsamba-f6bdffbf8dfc28329e87fcc383008c685110db96.tar.gz
samba-f6bdffbf8dfc28329e87fcc383008c685110db96.tar.bz2
samba-f6bdffbf8dfc28329e87fcc383008c685110db96.zip
Don't zero out numwritten before using.... Found by Pierre Belanger belanger@pobox.com
Jeremy. (This used to be commit 495e6e3287152a7ec218a38b3133f7ae16d5a8d1)
Diffstat (limited to 'source3/lib/sendfile.c')
-rw-r--r--source3/lib/sendfile.c4
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;