Skip to content

Commit 265ecad

Browse files
trufaeradare
authored andcommitted
Minor cleanup in cmd_print
1 parent 333e991 commit 265ecad

File tree

4 files changed

+179
-183
lines changed

4 files changed

+179
-183
lines changed

libr/core/casm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ static int is_hit_inrange(RCoreAsmHit *hit, ut64 start_range, ut64 end_range){
485485
R_API RList *r_core_asm_bwdisassemble(RCore *core, ut64 addr, int n, int len) {
486486
RAsmOp op;
487487
// if (n > core->blocksize) n = core->blocksize;
488-
ut64 at;
489488
ut32 idx = 0, hit_count;
490489
int numinstr, asmlen, ii;
491490
const int addrbytes = core->io->addrbytes;
@@ -494,8 +493,7 @@ R_API RList *r_core_asm_bwdisassemble(RCore *core, ut64 addr, int n, int len) {
494493
if (!hits) {
495494
return NULL;
496495
}
497-
498-
len = R_MIN (len - len % addrbytes, addrbytes * addr);
496+
len = R_MIN (len - (len % addrbytes), addrbytes * addr);
499497
if (len < 1) {
500498
r_list_free (hits);
501499
return NULL;
@@ -509,7 +507,7 @@ R_API RList *r_core_asm_bwdisassemble(RCore *core, ut64 addr, int n, int len) {
509507
free (buf);
510508
return NULL;
511509
}
512-
if (!r_io_read_at (core->io, addr - len / addrbytes, buf, len)) {
510+
if (!r_io_read_at (core->io, addr - (len / addrbytes), buf, len)) {
513511
r_list_free (hits);
514512
free (buf);
515513
return NULL;
@@ -536,7 +534,9 @@ R_API RList *r_core_asm_bwdisassemble(RCore *core, ut64 addr, int n, int len) {
536534
break;
537535
}
538536
}
539-
at = addr - idx / addrbytes;
537+
538+
ut64 at = addr - idx / addrbytes;
539+
540540
r_asm_set_pc (core->rasm, at);
541541
for (hit_count = 0; hit_count < n; hit_count++) {
542542
int instrlen = r_asm_disassemble (core->rasm, &op,

0 commit comments

Comments
 (0)