[Fontconfig] fontconfig: Branch 'master'
Akira TAGOH
akira at tagoh.org
Wed Feb 25 21:10:17 PST 2015
Thanks. that should be better now.
On Thu, Feb 26, 2015 at 8:17 AM, Raimund Steger <rs at mytum.de> wrote:
> Hi,
>
> there is still a problem. d_name gets cut off, hence stat won't find the
> file.
>
> I believe it's this:
>
> [...]
>> p = (struct dirent *) malloc (sizeof (struct dirent));
>> memcpy (p, dent, sizeof (struct dirent));
>>
>
> According to [1], d_name is indeed variable size though might be defined
> to size 1 in headers, so copying sizeof(struct dirent) with memcpy will
> likely not work.
>
> It seems most platforms have a (non-standard) d_reclen field, but the
> portable way would probably be to add strlen(d_name) before any copying is
> done.
>
> -Raimund
>
>
>
> [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
>
>
>
>
> --
> Worringer Str 31 Duesseldorf 40211 DE home: <rs at mytum.de>
> +49-179-2981632 icq 16845346 work: <rs at interface-ag.de>
>
--
Akira TAGOH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20150226/d74df65c/attachment.html>
More information about the Fontconfig
mailing list