Skip to content

Commit

Permalink
Merge branch 'dev' into modify-pr-command
Browse files Browse the repository at this point in the history
  • Loading branch information
HN026 authored Nov 23, 2023
2 parents 77a1901 + 78461f4 commit 5e4ee76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions librz/core/cbin.c
Original file line number Diff line number Diff line change
Expand Up @@ -4534,7 +4534,7 @@ RZ_API bool rz_core_bin_raise(RzCore *core, ut32 bfid) {
if (bf) {
rz_io_use_fd(core->io, bf->fd);
}
return bf && rz_core_bin_apply_all_info(core, bf) && rz_core_block_read(core);
return bf && rz_core_bin_apply_all_info(core, bf) && rz_core_block_read(core) > 0;
}

/**
Expand All @@ -4550,7 +4550,7 @@ RZ_API bool rz_core_binfiles_delete(RzCore *core, RzBinFile *bf) {
if (bf) {
rz_io_use_fd(core->io, bf->fd);
}
return bf && rz_core_bin_apply_all_info(core, bf) && rz_core_block_read(core);
return bf && rz_core_bin_apply_all_info(core, bf) && rz_core_block_read(core) > 0;
}

static void core_bin_file_print(RzCore *core, RzBinFile *bf, RzCmdStateOutput *state) {
Expand Down
11 changes: 3 additions & 8 deletions librz/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2782,16 +2782,11 @@ RZ_API bool rz_core_block_size(RzCore *core, ut32 bsize) {
ut8 *bump;
if (bsize == core->blocksize) {
return true;
}
if (bsize > core->blocksize_max) {
RZ_LOG_ERROR("Block size %d is too big\n", bsize);
return false;
}
if (bsize < 1) {
} else if (bsize < 1) {
bsize = 1;
} else if (core->blocksize_max && bsize > core->blocksize_max) {
RZ_LOG_ERROR("block size is bigger than its max (check `bm` command). set to 0x%x\n", core->blocksize_max);
bsize = core->blocksize_max;
RZ_LOG_ERROR("block size is bigger than its max 0x%x (check `bm` command)\n", core->blocksize_max);
return false;
}
bump = realloc(core->block, bsize + 1);
if (!bump) {
Expand Down

0 comments on commit 5e4ee76

Please sign in to comment.