Remove trailing spaces in px

This commit is contained in:
pancake 2016-05-31 21:23:55 +02:00
parent b226545595
commit 2bd189255e

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2007-2015 - pancake */
/* radare - LGPL - Copyright 2007-2016 - pancake */
#include "r_anal.h"
#include "r_cons.h"
@ -414,7 +414,7 @@ static void print_c_code(RPrint *p, ut64 addr, ut8 *buf, int len, int ws, int w)
}
R_API void r_print_code(RPrint *p, ut64 addr, ut8 *buf, int len, char lang) {
int ws, i, w = p->cols*0.7;
int i, w = p->cols*0.7;
switch (lang) {
case '?':
eprintf ("Valid print code formats are: JSON, C, Python, Cstring (pcj, pc, pcp, pcs) \n"
@ -682,7 +682,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
if (use_segoff) {
ut32 s, a;
a = addr & 0xffff;
s = ((addr-a)>>4 ) &0xffff;
s = ((addr - a) >> 4) & 0xffff;
snprintf (soff, sizeof (soff), "%04x:%04x ", s, a);
printfmt ("- offset -");
} else {
@ -708,8 +708,9 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
printfmt (col != 1 ? " " : ((i + 1) < inc) ? " " : "|");
}
printfmt ((col == 2) ? "|" : " ");
for (i = 0; i < inc; i++)
for (i = 0; i < inc; i++) {
printfmt ("%c", hex[(i+k)%16]);
}
printfmt (col == 2 ? "|\n" : "\n");
}
}
@ -783,7 +784,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
r_print_cursor (p, j, 0);
j += step - 1;
} else if (base == -8) {
printfmt(" %d=%c=%X ", -base, 0x3d, 13);
printfmt (" %d=%c=%X ", -base, 0x3d, 13);
j += 3;
} else if (base == -1) {
st8 *w = (st8*)(buf+j);
@ -797,29 +798,35 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
printfmt ("%13d ", *w);
j += 3;
} else {
if (j>=len) {
if (j >= len) {
break;
}
r_print_byte (p, fmt, j, buf[j]);
if (j%2 || !pairs) {
if (col==1) {
if (j+1<inc+i)
if (j + 1 < inc + i) {
printfmt (" ");
else printfmt ("|");
} else {
printfmt ("|");
}
} else printfmt (" ");
}
}
}
printfmt ((col == 2)? "|" : " ");
for (j = i; j < i+inc; j++) {
if (j >= len) printfmt (" ");
else r_print_byte (p, "%c", j, buf[j]);
for (j = i; j < i + inc; j++) {
if (j >= len) {
break;
}
r_print_byte (p, "%c", j, buf[j]);
}
if (col == 2) printfmt("|");
if (p && p->flags & R_PRINT_FLAGS_REFS) {
ut64 *foo = (ut64*)(buf+i);
ut64 addr = *foo;
if (base == 32) addr &= UT32_MAX;
if (base == 32) {
addr &= UT32_MAX;
}
if (p->hasrefs) {
const char *rstr = p->hasrefs (p->user, addr);
if (rstr && *rstr)