corrected region access
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Fri, 15 Jul 2022 03:30:07 +0000 (13:30 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Fri, 15 Jul 2022 03:30:07 +0000 (13:30 +1000)
fusefile.c

index 476ca9d8fb1ffa847e094150b44223a816ed7603..8e09b588316719670810ebdc1013c5e1076e60c7 100644 (file)
@@ -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;
        }