diff --git a/src/fcstat.c b/src/fcstat.c index d2eb258..d444bf9 100644 --- a/src/fcstat.c +++ b/src/fcstat.c @@ -215,13 +215,8 @@ FcScandir (const char *dirp, { if (!filter || (filter) (dent)) { - size_t dentlen = sizeof (struct dirent); - - if (sizeof (struct dirent) == FcPtrToOffset (dent, dent->d_name)) - { - dentlen += strlen (dent->d_name) + 1; - dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1)); - } + size_t dentlen = FcPtrToOffset (dent, dent->d_name) + strlen (dent->d_name) + 1; + dentlen = ((dentlen + ALIGNOF_VOID_P - 1) & ~(ALIGNOF_VOID_P - 1)); p = (struct dirent *) malloc (dentlen); memcpy (p, dent, dentlen); if (n >= lsize)