summaryrefslogtreecommitdiff
path: root/btrfs-convert.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfs-convert.c')
-rw-r--r--btrfs-convert.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/btrfs-convert.c b/btrfs-convert.c
index 4baa68ec..b49775cc 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -2600,8 +2600,8 @@ static int do_convert(const char *devname, int datacsum, int packing, int noxatt
}
memset(root->fs_info->super_copy->label, 0, BTRFS_LABEL_SIZE);
if (copylabel == 1) {
- strncpy(root->fs_info->super_copy->label,
- cctx.volume_name, BTRFS_LABEL_SIZE);
+ __strncpy_null(root->fs_info->super_copy->label,
+ cctx.volume_name, BTRFS_LABEL_SIZE - 1);
fprintf(stderr, "copy label '%s'\n",
root->fs_info->super_copy->label);
} else if (copylabel == -1) {
@@ -2781,7 +2781,7 @@ static int do_rollback(const char *devname)
goto fail;
} else if (ret < 0) {
fprintf(stderr,
- "ERROR: unable to open ext2_subvol, id=%llu: %s\n",
+ "ERROR: unable to open ext2_saved, id=%llu: %s\n",
(unsigned long long)key.objectid, strerror(-ret));
goto fail;
}
@@ -3116,8 +3116,7 @@ int main(int argc, char *argv[])
"WARNING: label too long, trimmed to %d bytes\n",
BTRFS_LABEL_SIZE - 1);
}
- strncpy(fslabel, optarg, BTRFS_LABEL_SIZE - 1);
- fslabel[BTRFS_LABEL_SIZE - 1] = 0;
+ __strncpy_null(fslabel, optarg, BTRFS_LABEL_SIZE - 1);
break;
case 'L':
copylabel = 1;
@@ -3165,9 +3164,8 @@ int main(int argc, char *argv[])
return c != GETOPT_VAL_HELP;
}
}
- argc = argc - optind;
set_argv0(argv);
- if (check_argc_exact(argc, 1)) {
+ if (check_argc_exact(argc - optind, 1)) {
print_usage();
return 1;
}