diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2014-02-20 09:30:52 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-03-21 06:23:20 -0700 |
commit | 64fddab8ac0ad7970cf713cfecba5ab6ae90b09c (patch) | |
tree | 2687a0eb2c5810bfafe6314e0e9718f6e3d37e56 /cmds-subvolume.c | |
parent | 86da12ff869823f4dae20488f3bedeae4a55086d (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-subvolume.c')
-rw-r--r-- | cmds-subvolume.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 0bd76f2e..5e821c71 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -820,11 +820,7 @@ static int cmd_subvol_set_default(int argc, char **argv) subvolid = argv[1]; path = argv[2]; - objectid = (unsigned long long)strtoll(subvolid, NULL, 0); - if (errno == ERANGE) { - fprintf(stderr, "ERROR: invalid tree id (%s)\n", subvolid); - return 1; - } + objectid = arg_strtou64(subvolid); fd = open_file_or_dir(path, &dirstream); if (fd < 0) { @@ -861,7 +857,7 @@ static int cmd_find_new(int argc, char **argv) usage(cmd_find_new_usage); subvol = argv[1]; - last_gen = atoll(argv[2]); + last_gen = arg_strtou64(argv[2]); ret = test_issubvolume(subvol); if (ret < 0) { |