- num = atol(optarg);
- bytenr = btrfs_sb_offset(num);
- printf("using SB copy %d, bytenr %llu\n", num,
- (unsigned long long)bytenr);
+ num = arg_strtou64(optarg);
+ if (num >= BTRFS_SUPER_MIRROR_MAX) {
+ fprintf(stderr,
+ "ERROR: super mirror should be less than: %d\n",
+ BTRFS_SUPER_MIRROR_MAX);
+ exit(1);
+ }
+ bytenr = btrfs_sb_offset(((int)num));