On 06/02/2013 10:10 AM, Peter Maydell wrote:
> +                    tde->d_ino = tswapal(ino);
> +                    tde->d_off = tswapal(off);
> +                    tde->d_reclen = tswap16(treclen);
> +                    memmove(tde->d_name, de->d_name, namelen + 1);

Wouldn't it be better to do the memmove first?  Then you really are reading all
of the dirent64 data first, like your comment says.

> +                    /* The target_dirent type is in what was formerly a 
> padding
> +                     * byte at the end of the structure:
> +                     */
> +                    *(((char *)tde) + treclen - 1) = type;

Maybe easier to read as

  ((char *)tde)[treclen - 1] = type

?


r~

Reply via email to