Compare commits

...
1 Commits
Author SHA1 Message Date
Antonio SJ Musumeci 4fe0e90bc3 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.
2025-09-30 11:01:31 -05:00
+4 -2
View File
@@ -2,6 +2,7 @@
#include <cstddef>
#include <cstdint>
#include <cstring>
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);
}
};
}