From: Ralph Ronnquist Date: Fri, 15 Jul 2022 03:30:07 +0000 (+1000) Subject: corrected region access X-Git-Tag: 0.4~10 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=5a6058dfa2458c6b146fdc84934bd2c8d17eb7ea;p=rrq%2Ffusefile.git corrected region access --- diff --git a/fusefile.c b/fusefile.c index 476ca9d..8e09b58 100644 --- a/fusefile.c +++ b/fusefile.c @@ -269,8 +269,8 @@ static int write_block(off_t off,const char *buf,size_t size) { return -EIO; // past EOF } struct Source *source = &sources.array[ index ]; - off_t from = off - source->start; - off_t max = source->to - source->from - from; + off_t from = off - source->start + source->from; + off_t max = source->to - from; if ( lseek( source->fd, from, SEEK_SET ) < 0 ) { return -EIO; }