mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
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.
This commit is contained in:
parent
e6fcebe4f3
commit
25b0bc72df
1 changed files with 4 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace fs
|
namespace fs
|
||||||
{
|
{
|
||||||
|
|
@ -15,9 +16,10 @@ namespace fs
|
||||||
char name[];
|
char name[];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
int namelen() const
|
size_t
|
||||||
|
namelen() const
|
||||||
{
|
{
|
||||||
return (reclen - offsetof(dirent64,name));
|
return ::strlen(name);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue