fix a small bug in sendfile