aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zdb
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2016-02-03 10:07:34 -0600
committerBrian Behlendorf <[email protected]>2016-02-05 11:29:38 -0800
commite989f19cba2beffb03351842c2da1409f68e4466 (patch)
treefef45de30cc408c767c637f62680df8e2884fcf0 /cmd/zdb
parent7c9abfa7ab0bc88e059800c6a5f8d2c2ebb62588 (diff)
Correctly parse -R flag arguments
Currently, only the 'b' flag takes an argument which is an offset into the block at which a blkptr should be decoded. The index into the flag string needed to be updated after parsing an argument. Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4304
Diffstat (limited to 'cmd/zdb')
-rw-r--r--cmd/zdb/zdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index c43d9d0bd..cbc98d24c 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -3385,8 +3385,10 @@ zdb_read_block(char *thing, spa_t *spa)
continue;
p = &flagstr[i + 1];
- if (bit == ZDB_FLAG_PRINT_BLKPTR)
+ if (bit == ZDB_FLAG_PRINT_BLKPTR) {
blkptr_offset = strtoull(p, &p, 16);
+ i = p - &flagstr[i + 1];
+ }
if (*p != ':' && *p != '\0') {
(void) printf("***Invalid flag arg: '%s'\n", s);
free(dup);