From 5883b194d5d24a4e27f3ed6778b25bd3ba095a8e Mon Sep 17 00:00:00 2001 From: szaka Date: Sat, 25 Apr 2009 13:20:03 +0000 Subject: [PATCH] fix passing buffer after partial read/write (Jean-Pierre Andre, Szabolcs Szakacsits) --- src/ntfs-3g.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 8785bae0..74c79447 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -752,7 +752,7 @@ static int ntfs_fuse_read(const char *org_path, char *buf, size_t size, size = na->data_size - offset; } while (size > 0) { - s64 ret = ntfs_attr_pread(na, offset, size, buf); + s64 ret = ntfs_attr_pread(na, offset, size, buf + total); if (ret != (s64)size) ntfs_log_perror("ntfs_attr_pread error reading '%s' at " "offset %lld: %lld <> %lld", org_path, @@ -804,7 +804,7 @@ static int ntfs_fuse_write(const char *org_path, const char *buf, size_t size, goto exit; } while (size) { - s64 ret = ntfs_attr_pwrite(na, offset, size, buf); + s64 ret = ntfs_attr_pwrite(na, offset, size, buf + total); if (0 <= ret && ret < (s64)size) ntfs_log_perror("ntfs_attr_pwrite partial write to '%s'" " (%lld: %lld <> %lld)", path, (long long)offset,