ext2_get_file_map(): Fix broken termination condition

This commit is contained in:
Ingo Weinhold
2013-11-11 22:27:54 +01:00
parent fd91d2cbe1
commit 05826ec74b
@@ -465,14 +465,15 @@ ext2_get_file_map(fs_volume* _volume, fs_vnode* _node, off_t offset,
} }
offset += blockLength; offset += blockLength;
size -= blockLength;
if ((off_t)size <= vecs[index - 1].length || offset >= inode->Size()) { if (offset >= inode->Size() || size <= blockLength) {
// We're done! // We're done!
*_count = index; *_count = index;
TRACE("ext2_get_file_map for inode %" B_PRIdINO "\n", inode->ID()); TRACE("ext2_get_file_map for inode %" B_PRIdINO "\n", inode->ID());
return B_OK; return B_OK;
} }
size -= blockLength;
} }
// can never get here // can never get here