Skip to content

Commit

Permalink
fixup! Use internal API instead of command
Browse files Browse the repository at this point in the history
  • Loading branch information
PeiweiHu committed Jan 3, 2024
1 parent 6d7863c commit f48c89b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions librz/core/cprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,18 @@ static void core_handle_call(RzCore *core, char *line, char **str) {
static char *cons_disassembly(RzCore *core, ut64 addr, ut32 byte_len, ut32 inst_len) {
rz_return_val_if_fail(core && (byte_len || inst_len), NULL);

// cbytes in disasm_options decides whether byte_len constrains inst_len
bool cbytes = true;

if (byte_len == 0) {
cbytes = false;
byte_len = inst_len;
}

if (inst_len == 0) {
inst_len = byte_len;
}

ut8 *block = malloc(byte_len + 1);
if (!block) {
RZ_LOG_ERROR("Cannot allocate buffer\n");
Expand Down

0 comments on commit f48c89b

Please sign in to comment.