]> git.saurik.com Git - apple/hfs.git/blobdiff - CopyHFSMeta/DeviceWrapper.c
hfs-195.tar.gz
[apple/hfs.git] / CopyHFSMeta / DeviceWrapper.c
index 27c9116f97e9a025504f05b5825d21f5cfb10d10..54f62ec22c00c70af6ffaae9a1be0ebcd7e95192 100644 (file)
@@ -59,9 +59,9 @@ writeExtent(struct IOWrapper *context, DeviceInfo_t *devp, off_t start, off_t le
                        warn("Cannot read from device at offset %lld", start + total);
                        return -1;
                }
-               (void)pwrite(ctx->fd, (char*)buffer + total, amt, start + total);
-               bp(amt);
-               total += amt;
+               (void)pwrite(ctx->fd, (char*)buffer, nread, start + total);
+               bp(nread);
+               total += nread;
        }
        return 0;
 }