Skip to content

Commit

Permalink
Use blocksize to determine size for rz_cmd_disassembly_n_bytes_handle…
Browse files Browse the repository at this point in the history
…r() (#4714)
  • Loading branch information
winterheart authored Nov 12, 2024
1 parent cbcae30 commit d2bd940
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions librz/core/cmd/cmd_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -3262,11 +3262,7 @@ static bool core_disassembly(RzCore *core, int n_bytes, int n_instrs, RzCmdState
}

RZ_IPI RzCmdStatus rz_cmd_disassembly_n_bytes_handler(RzCore *core, int argc, const char **argv, RzCmdStateOutput *state) {
if (argc <= 1) {
RZ_LOG_ERROR("Invalid number of arguments\n");
return RZ_CMD_STATUS_ERROR;
}
int n_bytes = (int)rz_num_math(core->num, argv[1]);
ut64 n_bytes = argc > 1 ? (ut64)rz_num_math(core->num, argv[1]) : core->blocksize;
if (n_bytes == 0) {
RZ_LOG_ERROR("The argument cannot be zero\n");
return RZ_CMD_STATUS_ERROR;
Expand Down

0 comments on commit d2bd940

Please sign in to comment.