btrfs-progs/convert
David Sterba a35409328e 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-17 21:53:04 +02:00
..
common.c btrfs-progs: rename and move __strncpy_null to string-utils 2024-06-17 21:52:48 +02:00
common.h btrfs-progs: convert: move simple_range into common.h 2022-10-11 09:08:08 +02:00
main.c btrfs-progs: use strncpy_null everywhere 2024-06-17 21:53:04 +02:00
Makefile btrfs-progs: build: add stub makefile to convert 2017-03-08 13:00:46 +01:00
source-ext2.c btrfs-progs: use strncpy_null everywhere 2024-06-17 21:53:04 +02:00
source-ext2.h btrfs-progs: convert: update include lists 2022-10-11 09:06:12 +02:00
source-fs.c btrfs-progs: reorder key initializations 2024-04-30 21:49:15 +02:00
source-fs.h btrfs-progs: convert defined constants to enums 2024-02-08 08:30:37 +01:00
source-reiserfs.c btrfs-progs: move btrfs_record_file_extent and code into a new file 2023-10-03 01:11:56 +02:00
source-reiserfs.h btrfs-progs: convert: update include lists 2022-10-11 09:06:12 +02:00