Skip to content

Commit e10952c

Browse files
authored
Prevent printing metadata block twice in info, when only one block present (#271)
Noticed in #270
1 parent 735e0d7 commit e10952c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3697,15 +3697,15 @@ void info_guts(memory_access &raw_access, void *con) {
36973697
bin = raw_access.read_vector<uint8_t>(raw_access.get_binary_start(), read_size, true);
36983698
std::unique_ptr<block> first_block = find_first_block(bin, raw_access.get_binary_start());
36993699
if (first_block) {
3700-
// verify stuff
3701-
auto all_blocks = get_all_blocks(bin, raw_access.get_binary_start(), first_block, more_cb);
3702-
37033700
int block_i = 0;
37043701
select_group(metadata_info[block_i++], true);
37053702
info_metadata(first_block.get(), true);
3706-
for (auto &block : all_blocks) {
3707-
select_group(metadata_info[block_i++], true);
3708-
info_metadata(block.get(), true);
3703+
if (first_block->next_block_rel != 0) { // if there is more than one block
3704+
auto all_blocks = get_all_blocks(bin, raw_access.get_binary_start(), first_block, more_cb);
3705+
for (auto &block : all_blocks) {
3706+
select_group(metadata_info[block_i++], true);
3707+
info_metadata(block.get(), true);
3708+
}
37093709
}
37103710
} else {
37113711
// This displays that there are no metadata blocks

0 commit comments

Comments
 (0)