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 <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #4304
This commit is contained in:
parent
b145e23daf
commit
d41e763c72
|
@ -3357,8 +3357,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);
|
||||
|
|
Loading…
Reference in New Issue