ext2: align dirent struct pointers with next_dirent()

Change-Id: Iaf102916d77f077c48348e2d1e7deff8f37d1232
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5634
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Jérôme Duval 2022-09-09 14:22:51 +02:00 committed by waddlesplash
parent e065d697fb
commit a4f09ce9d0

View File

@ -12,6 +12,7 @@
#include <string.h>
#include <AutoDeleter.h>
#include <file_systems/fs_ops_support.h>
#include <fs_cache.h>
#include <fs_info.h>
#include <io_requests.h>
@ -1469,10 +1470,8 @@ ext2_read_dir(fs_volume *_volume, fs_vnode *_node, void *_cookie,
dirent->d_dev = volume->ID();
dirent->d_ino = id;
dirent->d_reclen = offsetof(struct dirent, d_name) + length + 1;
bufferSize -= dirent->d_reclen;
dirent = (struct dirent*)((uint8*)dirent + dirent->d_reclen);
dirent = next_dirent(dirent, length, bufferSize);
count++;
}