aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-subvolume.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-subvolume.c
parent86da12ff869823f4dae20488f3bedeae4a55086d (diff)
downloadbtrfs-progs-64fddab8ac0ad7970cf713cfecba5ab6ae90b09c.tar.gz
btrfs-progs-64fddab8ac0ad7970cf713cfecba5ab6ae90b09c.tar.xz
btrfs-progs-64fddab8ac0ad7970cf713cfecba5ab6ae90b09c.zip
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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 0bd76f2..5e821c7 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) {