GCC versions 9 and later complain more agressively, e.g.:
common.c: In function ‘get_wwnid_from_pretty’:
common.c:396:4: warning: ‘strncpy’ offset [275, 4095] from the object at ‘drd’ is out of the bounds of referenced subobject ‘d_name’ with type ‘char[256]’ at offset 19 [-Warray-bounds]
396 | strncpy(wwn_name, drd->d_name, sizeof(wwn_name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/dirent.h:61,
from common.c:32:
/usr/include/bits/dirent.h:33:10: note: subobject ‘d_name’ declared here
33 | char d_name[256]; /* We must not include limits.h! */
| ^~~~~~
or:
common.c: In function ‘get_persistent_name_path’:
common.c:876:37: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
876 | snprintf(path, sizeof(path), "%s/%s",
| ^
common.c:876:2: note: ‘snprintf’ output 2 or more bytes (assuming 4097) into a destination of size 4096
876 | snprintf(path, sizeof(path), "%s/%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
877 | get_persistent_type_dir(persistent_name_type), name);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~