mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-18 03:44:28 +00:00
Fix more color issues in pxa
This commit is contained in:
parent
be66c5149d
commit
27650d1f42
@ -43,7 +43,7 @@ R_API void r_cons_pal_init(const char *foo) {
|
||||
|
||||
cons->pal.list[0] = strdup (Color_RED);
|
||||
cons->pal.list[1] = strdup (Color_YELLOW);
|
||||
cons->pal.list[2] = strdup (Color_WHITE);
|
||||
cons->pal.list[2] = strdup (Color_BGREEN);
|
||||
cons->pal.list[3] = strdup (Color_CYAN);
|
||||
cons->pal.list[4] = strdup (Color_MAGENTA);
|
||||
cons->pal.list[5] = strdup (Color_GRAY);
|
||||
|
@ -189,7 +189,7 @@ static void annotated_hexdump(RCore *core, const char *str, int len) {
|
||||
echars = chars;
|
||||
hascolor = R_FALSE;
|
||||
|
||||
if (usecolor) append (ebytes, Color_GREEN);
|
||||
if (usecolor) append (ebytes, core->cons->pal.offset);
|
||||
ebytes += sprintf (ebytes, "0x%08"PFMT64x, addr);
|
||||
if (usecolor) append (ebytes, Color_RESET);
|
||||
append (ebytes, (col==1)?" |":" ");
|
||||
@ -298,9 +298,10 @@ static void annotated_hexdump(RCore *core, const char *str, int len) {
|
||||
for (j=0; j<nb_cols; j++) {
|
||||
if (note[j]) {
|
||||
int off = (j*3) - (j/2) + 12;
|
||||
int sz = R_MIN (strlen (note[j]), nb_cons_cols-(off+13));
|
||||
if (j%2) off--;
|
||||
memcpy (out+off, note[j], //avoid overflow
|
||||
R_MIN(strlen (note[j]), nb_cons_cols-(off+13)));
|
||||
memcpy (out+off, note[j], sz); //avoid overflow
|
||||
out[off+sz] = 0;
|
||||
hasline = (out[off] != ' ');
|
||||
free (note[j]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user