On Tue, Jun 6, 2023 at 3:28 PM Corinna Vinschen
<corinna-cyg...@cygwin.com> wrote:
> Yes, it is wrong, because the value of MAX_EA_NAME_LEN / XATTR_NAME_MAX
> is used for array size definitions as well as comparisons.

Do you prefer to keep MAX_EA_NAME_LEN and just have that set like,
perhaps with an additional comment that explains it:
   #define MAX_EA_NAME_LEN    (XATTR_NAME_MAX + 1 - strlen("user."))
or rather inline all that without any MAX_EA_NAME_LEN?

I think at least GCC and CLANG should be smart enough to optimise the
strlen() on a static string.

Regards,
Philippe

Reply via email to