HomeFreeBSD

fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning

Description

fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning

tests/sys/fs/fusefs/xattr.cc:572:50: error: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Werror,-Wstrlcpy-strlcat-size]

572 |                         strlcpy((char*)out.body.bytes, attrs1, sizeof(attrs1));
    |                                                                ~~~~~~~^~~~~~~

The warning is correct in that the size is the size of the source, but
that is intended in this case. Use memcpy() instead of strlcpy() to
match the same code in the size_only_race_smaller test above.

Differential Revision: https://reviews.freebsd.org/D49786

Details

Provenance
jhbAuthored on Apr 11 2025, 7:12 PM
Differential Revision
D49786: fusefs tests: Use memcpy to work around a -Wstrlcpy-strlcast-size warning
Parents
rG4b60fac3a5c7: kinfo_getfile: Add a comment explaining 4/3 ratio
Branches
Unknown
Tags
Unknown