btrfs-progs/mkfs
David Sterba 4db925911c btrfs-progs: use strncpy_null everywhere
Use the safe version of strncpy that makes sure the string is
terminated.

To be noted:

- the conversion in scrub path handling was skipped
- sizes of device paths in some ioctl related structures is
  BTRFS_DEVICE_PATH_NAME_MAX + 1

Recently gcc 13.3 started to detect problems with our use of strncpy
potentially lacking the null terminator, warnings like:

cmds/inspect.c: In function ‘cmd_inspect_logical_resolve’:
cmds/inspect.c:294:33: warning: ‘__builtin_strncpy’ specified bound 4096 equals destination size [-Wstringop-truncation]
  294 |                                 strncpy(mount_path, mounted, PATH_MAX);
      |                                 ^

Signed-off-by: David Sterba <dsterba@suse.com>
2024-06-24 19:18:48 +02:00
..
Makefile
common.c btrfs-progs: rename and move __strncpy_null to string-utils 2024-06-24 19:18:46 +02:00
common.h btrfs-progs: mkfs: unify zoned mode minimum size calc into btrfs_min_dev_size() 2024-06-03 21:15:26 +02:00
main.c btrfs-progs: use strncpy_null everywhere 2024-06-24 19:18:48 +02:00
rootdir.c btrfs-progs: reorder key initializations 2024-04-30 21:49:15 +02:00
rootdir.h btrfs-progs: mkfs: more verbose output for --rootdir 2023-05-26 22:17:33 +02:00