mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
synced 2024-11-27 11:43:36 +08:00
f2fs-tools: use either hex or decimal options
This patch supports both hex and decimal when using nid as option. Signed-off-by: Changman Lee <cm224.lee@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
parent
223fdf3e00
commit
932f9845f6
10
fsck/main.c
10
fsck/main.c
@ -76,7 +76,10 @@ void f2fs_parse_options(int argc, char *argv[])
|
||||
MSG(0, "Info: Debug level = %d\n", config.dbg_lv);
|
||||
break;
|
||||
case 'i':
|
||||
sscanf(optarg, "%x", &dump_opt.nid);
|
||||
if (strncmp(optarg, "0x", 2))
|
||||
sscanf(optarg, "%d", &dump_opt.nid);
|
||||
else
|
||||
sscanf(optarg, "%x", &dump_opt.nid);
|
||||
break;
|
||||
case 's':
|
||||
sscanf(optarg, "%d~%d", &dump_opt.start_sit, &dump_opt.end_sit);
|
||||
@ -85,7 +88,10 @@ void f2fs_parse_options(int argc, char *argv[])
|
||||
sscanf(optarg, "%d~%d", &dump_opt.start_ssa, &dump_opt.end_ssa);
|
||||
break;
|
||||
case 'b':
|
||||
sscanf(optarg, "%d", &dump_opt.blk_addr);
|
||||
if (strncmp(optarg, "0x", 2))
|
||||
sscanf(optarg, "%d", &dump_opt.blk_addr);
|
||||
else
|
||||
sscanf(optarg, "%x", &dump_opt.blk_addr);
|
||||
break;
|
||||
default:
|
||||
MSG(0, "\tError: Unknown option %c\n", option);
|
||||
|
Loading…
Reference in New Issue
Block a user