summaryrefslogtreecommitdiff
path: root/cmds-replace.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-02-20 09:30:52 +0800
committerChris Mason <clm@fb.com>2014-03-21 06:23:20 -0700
commit64fddab8ac0ad7970cf713cfecba5ab6ae90b09c (patch)
tree2687a0eb2c5810bfafe6314e0e9718f6e3d37e56 /cmds-replace.c
parent86da12ff869823f4dae20488f3bedeae4a55086d (diff)
Btrfs-progs: switch to arg_strtou64() part3
Switch to new helper arg_strtou64(), also check if user assign a valid super copy. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'cmds-replace.c')
-rw-r--r--cmds-replace.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/cmds-replace.c b/cmds-replace.c
index c683d6c4..01ab77c9 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -210,12 +210,7 @@ static int cmd_start_replace(int argc, char **argv)
struct btrfs_ioctl_fs_info_args fi_args;
struct btrfs_ioctl_dev_info_args *di_args = NULL;
- if (atoi(srcdev) == 0) {
- fprintf(stderr, "Error: Failed to parse the numerical devid value '%s'\n",
- srcdev);
- goto leave_with_error;
- }
- start_args.start.srcdevid = (__u64)atoi(srcdev);
+ start_args.start.srcdevid = arg_strtou64(srcdev);
ret = get_fs_info(path, &fi_args, &di_args);
if (ret) {