Remove noisy printfs and use more calloc

This commit is contained in:
pancake 2018-01-22 17:44:33 +01:00
parent 7c8252c6f3
commit b57fe402c7
2 changed files with 4 additions and 6 deletions

View File

@ -2369,7 +2369,6 @@ jmp $$ + 4 + ( [delta] * 2 )
int regBase = REGBASE(0);
int delta = MEMDISP(0);
if (regBase == ARM_REG_PC) {
eprintf ("IS PC\n");
op->ptr = addr + 4 + delta;
} else {
// exotic pld

View File

@ -867,7 +867,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
if (p) {
p->interrupt = 0;
}
for (i = j = 0; i < len; i += (stride? stride: inc), j += (stride? stride: 0)) {
for (i = j = 0; i < len; i += (stride? stride: inc), j += (stride? stride: 1)) {
r_print_set_screenbounds (p, addr + i);
if (p && p->cons && p->cons->breaked) {
break;
@ -1326,16 +1326,15 @@ R_API void r_print_zoom(RPrint *p, void *user, RPrintZoomCallback cb, ut64 from,
size = p->zoom->size;
} else {
mode = p->zoom->mode;
bufz = (ut8 *) malloc (len);
bufz = (ut8 *) calloc (1, len);
if (!bufz) {
return;
}
bufz2 = (ut8 *) malloc (size);
bufz2 = (ut8 *) calloc (1, size);
if (!bufz2) {
free (bufz);
return;
}
memset (bufz, 0, len);
// TODO: memoize blocks or gtfo
for (i = 0; i < len; i++) {
@ -1349,7 +1348,7 @@ R_API void r_print_zoom(RPrint *p, void *user, RPrintZoomCallback cb, ut64 from,
p->zoom->buf = bufz;
p->zoom->from = from;
p->zoom->to = to;
p->zoom->size = size;
p->zoom->size = len; // size;
}
p->flags &= ~R_PRINT_FLAGS_HEADER;
r_print_hexdump (p, from, bufz, len, 16, 1, size);