Browse Source

Fix dirent64::namelen calculation (#1538)

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.
pull/1540/head 2.41.0-rc1
trapexit 4 days ago
committed by GitHub
parent
commit
25b0bc72df
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      libfuse/include/fs_dirent64.hpp

6
libfuse/include/fs_dirent64.hpp

@ -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);
}
};
}
Loading…
Cancel
Save