From 4fe0e90bc3fb902dc1f40ffc4a26e6d1654fcd80 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 30 Sep 2025 09:19:58 -0500 Subject: [PATCH] Fix dirent64::namelen calculation Worked fine on my machine where padding seemed to be all zeroed out but that doesn't appear to be the case elsewhere. Could try https://codeberg.org/jbruchon/libjodycode/src/branch/master/dir.c#L92-L110 but needs to be tested. --- libfuse/include/fs_dirent64.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libfuse/include/fs_dirent64.hpp b/libfuse/include/fs_dirent64.hpp index 54052862..d3dd5fb6 100644 --- a/libfuse/include/fs_dirent64.hpp +++ b/libfuse/include/fs_dirent64.hpp @@ -2,6 +2,7 @@ #include #include +#include namespace fs { @@ -15,9 +16,10 @@ namespace fs char name[]; public: - int namelen() const + size_t + namelen() const { - return (reclen - offsetof(dirent64,name)); + return ::strlen(name); } }; }