diff --git a/src/add-ons/kernel/file_systems/ntfs/attributes.c b/src/add-ons/kernel/file_systems/ntfs/attributes.c index adc1fd8a6c..1a13831eae 100644 --- a/src/add-ons/kernel/file_systems/ntfs/attributes.c +++ b/src/add-ons/kernel/file_systems/ntfs/attributes.c @@ -533,10 +533,11 @@ fs_read_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos, size = na->data_size - pos; while (size > 0) { + s64 bytesRead; s64 sizeToRead = size; if (tempBuffer != NULL && size > TEMP_BUFFER_SIZE) sizeToRead = TEMP_BUFFER_SIZE; - s64 bytesRead = ntfs_attr_pread(na, pos, sizeToRead, + bytesRead = ntfs_attr_pread(na, pos, sizeToRead, tempBuffer != NULL ? tempBuffer : (void*)buffer); if (bytesRead <= 0) { *len = 0; @@ -646,6 +647,7 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos, } while (size > 0) { + s64 bytesWritten; s64 sizeToWrite = size; if (tempBuffer != NULL) { if (size > TEMP_BUFFER_SIZE) @@ -655,7 +657,7 @@ fs_write_attrib(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos, goto exit; } } - s64 bytesWritten = ntfs_attr_pwrite(na, pos, sizeToWrite, + bytesWritten = ntfs_attr_pwrite(na, pos, sizeToWrite, tempBuffer != NULL ? tempBuffer : (void*)buffer); if (bytesWritten <= 0) { ERROR("%s - ntfs_attr_pwrite()<=0\n", __FUNCTION__); diff --git a/src/add-ons/kernel/file_systems/ntfs/fs_func.c b/src/add-ons/kernel/file_systems/ntfs/fs_func.c index 68c667e8c0..0977efb6b4 100644 --- a/src/add-ons/kernel/file_systems/ntfs/fs_func.c +++ b/src/add-ons/kernel/file_systems/ntfs/fs_func.c @@ -1242,10 +1242,11 @@ fs_read(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t offset, void *buf } while (size > 0) { + s64 bytesRead; s64 sizeToRead = size; if (tempBuffer != NULL && size > TEMP_BUFFER_SIZE) sizeToRead = TEMP_BUFFER_SIZE; - s64 bytesRead = ntfs_attr_pread(na, offset, sizeToRead, + bytesRead = ntfs_attr_pread(na, offset, sizeToRead, tempBuffer != NULL ? tempBuffer : (void*)buffer); if (bytesRead <= 0) { *len = 0; @@ -1362,6 +1363,7 @@ fs_write(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t offset, } while (size > 0) { + s64 bytesWritten; s64 sizeToWrite = size; if (tempBuffer != NULL) { if (size > TEMP_BUFFER_SIZE) @@ -1371,7 +1373,7 @@ fs_write(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t offset, goto exit; } } - s64 bytesWritten = ntfs_attr_pwrite(na, offset, sizeToWrite, + bytesWritten = ntfs_attr_pwrite(na, offset, sizeToWrite, tempBuffer != NULL ? tempBuffer : (void*)buffer); if (bytesWritten <= 0) { ERROR("fs_write - ntfs_attr_pwrite()<=0\n");