fix passing buffer after partial read/write (Jean-Pierre Andre, Szabolcs Szakacsits)

N2009_11_14_FIXES
jpandre 2009-11-05 11:24:39 +00:00
parent 2005c92981
commit 79cc70f23c
1 changed files with 2 additions and 2 deletions

View File

@ -987,7 +987,7 @@ static int ntfs_fuse_read(const char *org_path, char *buf, size_t size,
size = max_read - 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,
@ -1039,7 +1039,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[total]);
s64 ret = ntfs_attr_pwrite(na, offset, size, buf + total);
if (ret <= 0) {
res = -errno;
goto exit;