mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
gcc warns here about storring 69 bytes in 64 byte array (losing potentially 4 bytes from 'ls->name'). lvmlockd-core.c:2657:36: warning: ‘%s’ directive output may be truncated writing up to 64 bytes into a region of size 60 [-Wformat-truncation=] snprintf(tmp_name, MAX_NAME, "REM:%s", ls->name); ^~ lvmlockd-core.c:2657:2: note: ‘snprintf’ output between 5 and 69 bytes into a destination of size 64 snprintf(tmp_name, MAX_NAME, "REM:%s", ls->name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Replaced with slightly better code - but it still misses error path what to do if the name would be truncated... - so added FIXME. Also using all bytes for snprintf() buffer size (as the size is with \0 included)